SHARE
TWEET

Untitled

a guest Jul 21st, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Button button = (Button)findViewById(R.id.button);
  2. button.setOnClickListener(new View.OnClickListener() {
  3.     @Override
  4.     public void onClick(View v) {
  5.         Toast.makeText(this, "Button clicked", Toast.LENGTH_LONG).show();
  6.     }
  7. });
  8.      
  9. Button button = (Button)findViewById(R.id.button);
  10. button.setOnClickListener(v -> Toast.makeText(this, "Button clicked", Toast.LENGTH_LONG).show());
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top