Skip to content

Instantly share code, notes, and snippets.

@topherPedersen
Last active November 26, 2017 10:09
Show Gist options
  • Save topherPedersen/af230f895982694c858d1e4a966c9ea7 to your computer and use it in GitHub Desktop.
Save topherPedersen/af230f895982694c858d1e4a966c9ea7 to your computer and use it in GitHub Desktop.
setOnClickListener (Android/Java)
Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// do stuff
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment