change button text when clicked android studio

124

change button text when clicked android studio -

@Override
public void onClick(View v) {
    if(v.getId() == R.id.yourbuttonid) {
        btn.setText("X");
    }else if(v.getId() == R.id.yourbuttonid2){
        btn2.setText("X");
    }
}

Comments

Submit
0 Comments