所以我在活动 Home 中有:
setContentView(R.layout.home);
现在,从 Home 活动中,可以转到 Settings 活动,该活动具有:
setContentView(R.layout.settings);
它有几个 CheckBoxes 和 EditTexts。
是否可以从 Home 活动中编辑这些复选框的状态?
我已经像这样在 Home 中声明了它们:
CheckBox checkBox1 = (CheckBox) findViewById(R.id.checkBox1);
哪个发现ID很好,但应用程序在我尝试的那一行崩溃
checkBox1.setChecked(true);
不能从其他活动中访问它吗?
谢谢