清除按钮中的文本android studio

问题描述:

这是我的代码清除按钮中的文本android studio

button.getText()。clear(); error in clear()

明确的是红色和Android工作室是不是recognizing.please帮我清除按钮文本

+2

button.setText(”“)将为您工作! –

+0

你想清除按钮的文字? – AbhayBohra

+0

非常感谢。它的工作 – Bhanusri

你应该使用

button.setText( “”);

button.getText().clear() 

.getText()从按钮,以便改变它获取文本(字符串),以button.setText( “”)功能设置文本从按钮.setText(“URE变化文字“)