在我的应用程序中加载活动时,我正在执行以下操作
setContentView(R.layout.main2);
layoutToAdd = (LinearLayout) findViewById(R.id.linearLayout1);
for(i=0; i<num;i++)
{
LayoutInflater inflater = LayoutInflater.from(getApplicationContext());
View view = inflater.inflate(R.layout.camera, null);
layoutToAdd.addView(view);
}
num 的值每次都不同。
在我的 LayoutInflater 布局中,我有一个文本视图、编辑文本和一个按钮。
现在它们根据中提到的次数显示num
,现在每次我想要更改文本和按钮名称。如何设置 TextView 和 Button 的文本。