清除按钮中的文本android studio
问题描述:
这是我的代码清除按钮中的文本android studio
button.getText()。clear(); error in clear()
明确的是红色和Android工作室是不是recognizing.please帮我清除按钮文本
答
你应该使用
button.setText( “”);
答
button.getText().clear()
.getText()从按钮,以便改变它获取文本(字符串),以button.setText( “”)功能设置文本从按钮.setText(“URE变化文字“)
button.setText(”“)将为您工作! –
你想清除按钮的文字? – AbhayBohra
非常感谢。它的工作 – Bhanusri