【发布时间】:2018-09-13 21:41:09
【问题描述】:
checkbox should be created in red zone when button is clicked
我试过这个:
public void newcheckbox() {
LinearLayout my_layout = (LinearLayout)findViewById(R.id.my_layout);
CheckBox checkBox = new CheckBox(getApplicationContext());
checkBox.setText(""+ETnewcheckbox.getText().toString());
my_layout.addView(checkBox);
}
【问题讨论】:
-
您的具体问题是什么
-
试过了吗?干得好!
-
点击该按钮时应用程序崩溃
-
与问题和整个活动代码共享您的崩溃日志
-
查看已编辑问题中的图片