我怎麼知道CheckBox被點擊或沒有點擊? 感謝所有我怎麼知道CheckBox被點擊或沒有點擊?
XML文件:
<CheckBox
android:id="@+id/checkBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CheckBox" />
的java文件:
public class Setting extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_setting);
}
}
'((複選框)findViewById(R.id.checkBox).setOnCheckedChangedListener(...)' –
可能重複[Android:複選框偵聽器](http://stackoverflow.com/questions/8386832/android-checkbox-listener) –