Change button text and action - android development
final Button testButton = (Button) findViewById(R.id.button1);
testButton.setTag(1);
testButton.setText("Edit");
testButton.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick (View v) {
final int status =(Integer) v.getTag();
if(status == 1) {
mPlayer.start();
testButton.setText("Done");
v.setTag(0); //pause
} else {
testButton.setText("Edit");
v.setTag(1); //pause
}
Comments
Post a Comment