daily pastebin goal
23%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import android.support.v7.app.AppCompatActivity;
  2. import android.os.Bundle;
  3. import android.util.Log;
  4. import android.view.View;
  5. import android.widget.Button;
  6. import android.widget.EditText;
  7. import android.widget.Toast;
  8.  
  9. public class MainActivity extends AppCompatActivity {
  10.  
  11.     @Override
  12.     protected void onCreate(Bundle savedInstanceState) {
  13.         super.onCreate(savedInstanceState);
  14.         setContentView(R.layout.activity_main);
  15.  
  16.         Button btnFirst = findViewById(R.id.btn_first);
  17.      
  18. //      With Lambda Expressions
  19.         btnFirst.setOnClickListener(view -> Toast.makeText(MainActivity.this, "First Button Clicked", Toast.LENGTH_SHORT).show());
  20.  
  21.     }
  22. }
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
 
Top