问题
I am new in android, i have created alert dialog box on that i kept check boxes for selecting multiple week days, after checking days on check box i need to set those selected days to text view. I searched a lot for that but i don't found satisfactory answer please anyone can help me resolve this issue. Thanks in advance
回答1:
try this
if(checkBox.isSelected()){
String s = checkBox.getText().toString();
}
This way you can get Value of all of you checkbox.
At last you can set that string value to your textview
.
回答2:
Try the following code
checkBox.setSelected(selected);
来源:https://stackoverflow.com/questions/19676690/how-to-set-checkbox-cheked-value-to-textview-in-android