Adding Code to a Button Click in Android Studio

Опубликовано: 12 Март 2025
на канале: Prof. Vanselow
295,090
505

The entered code (so you can copy and paste):
1.
public void buttonOnClick(View v) {
// do something when the button is clicked
}
2.
Button button=(Button) v;
3.
Then I typed v.settext and hit Tab to autocomplete the line ((Button) v).setText("clicked");

See supplemental information at http://www.i-programmer.info/programm...