How to set Checkbox cheked value to textview in android?

你离开我真会死。 提交于 2019-12-25 18:06:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!