Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. package com.example.percobaanrelativelayout;
  2.  
  3. import android.support.v7.app.AppCompatActivity;
  4. import android.os.Bundle;
  5. import android.view.View;
  6. import android.widget.Button;
  7. import android.widget.Toast;
  8.  
  9. public class MainActivity extends AppCompatActivity implements View.OnClickListener {
  10. Button btnLogin;
  11.  
  12. @Override
  13. protected void onCreate(Bundle savedInstanceState) {
  14. super.onCreate(savedInstanceState);
  15. setContentView(R.layout.activity_main);
  16.  
  17. btnLogin = findViewById(R.id.btn_login);
  18.  
  19. btnLogin.setOnClickListener(this);
  20.  
  21. }
  22.  
  23. @Override
  24. public void onClick(View view) {
  25. if(view.getId()==R.id.btn_login){
  26. Toast.makeText(this,"Anda berhasil Login!",Toast.LENGTH_LONG).show();
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement