开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜