Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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");
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #button #text #clicked #android #studio
ADD COMMENT
Topic
Name
2+5 =