navasmdc / MaterialDesignLibrary

This is a library with components of Android L to you use in android 2.2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

opened this issue · 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?

change it in your xml file.

I have to change the text programmatically...

commented

import android.widget.Button;