CheckBox.setText do not work (Android)
CheckBox checkBox = new CheckBox(activity);
CheckBox.setText("Hello");
I tried to set the text after a check 开发者_如何转开发box as above. But it didnt show me anything. Any suggestions ?
First : you try to set the Text using the name of the class CheckBox
???
it should be the instance checkBox
, like this :
CheckBox checkBox = new CheckBox(activity);
checkBox.setText("Hello");
Second :
did you try to add your checkBox to your Activity Content like this ??
this.setContentView(checkBox);
EDIT: : refer this , may be it will help you
精彩评论