Last active
December 18, 2015 07:00
-
-
Save scttymn/5743764 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends Activity implements View.OnClickListener { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
Button clickMe = (Button) findViewById(R.id.button_name); | |
clickMe.setOnClickListener(this); | |
} | |
@Override | |
public void onClick(View view) { | |
if(view.getId() == R.id.button_name) { | |
// handle button click event. Since the view in this scope, is your | |
// button, you could change the text on it here. | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment