📌  相关文章
📜  如何以编程方式设置在 android 中选中的单选按钮 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:29.599000             🧑  作者: Mango

代码示例1
In your layout you can add android:checked="true" to CheckBox you want to be selected.

Or programmatically, you can use the setChecked method defined in the checkable interface:

RadioButton b = (RadioButton) findViewById(R.id.option1);
b.setChecked(true);