MaterialDesignLibrary icon indicating copy to clipboard operation
MaterialDesignLibrary copied to clipboard

ButtonFlat.setText("test") - cannot resolve method setText

Open ghost opened this issue 9 years ago • 3 comments

Hi. I want to change the text in a FlatButton but Android Studio says "Cannot resolve method 'setText(java.lang.string)'".

My Code:

import com.gc.materialdesign.views.Button;
//...
Button btnRecord = (Button)findViewById(R.id.btnRecord);
btnRecord.setText("test");

How can I change the text of the button?

ghost avatar Aug 18 '15 20:08 ghost

change it in your xml file.

robbStarkTFG4 avatar Aug 19 '15 18:08 robbStarkTFG4

I have to change the text programmatically...

ghost avatar Aug 19 '15 19:08 ghost

import android.widget.Button;

dzaen avatar Feb 22 '16 21:02 dzaen