当你还记得一个关于checkBoxes的好教程时,请告诉我!
答案 0 :(得分:0)
您使用以下方式获取州:
boolean selected = checkBox.isChecked();
然后,您可以在View对象上添加OnLayoutChangeListener
用法示例:
View.addOnLayoutChangeListener(new OnLayoutChangeListener(){
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom){
boolean selected = ((CheckBox)v.findViewById(R.id.yourCheckBoxID)).isChecked();
//saveTheStateHere
}
});