Skip to content

Instantly share code, notes, and snippets.

@sidward35
Last active January 2, 2020 06:04
Show Gist options
  • Save sidward35/284ea3032d548e5eb2f2a025f31faabf to your computer and use it in GitHub Desktop.
Save sidward35/284ea3032d548e5eb2f2a025f31faabf to your computer and use it in GitHub Desktop.
Android Button OnClickListener
Button button = findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//some stuff
}
});
@sidward35
Copy link
Author

Casting 'findViewById(R.id.button)' with (Button) is now redundant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment