Last active
January 2, 2020 06:04
-
-
Save sidward35/284ea3032d548e5eb2f2a025f31faabf to your computer and use it in GitHub Desktop.
Android Button OnClickListener
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
Button button = findViewById(R.id.button); | |
button.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
//some stuff | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Casting 'findViewById(R.id.button)' with (Button) is now redundant