Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. package com.android;
  2.  
  3. import android.app.Activity;
  4. import android.os.Bundle;
  5. import android.view.View;
  6. import android.widget.Button;
  7. import android.widget.EditText;
  8. import android.widget.Toast;
  9.  
  10. public class Login extends Activity
  11. {
  12. EditText user, pass;
  13. Button login;
  14.  
  15. public void onCreate(Bundle savedInstanceState)
  16. {
  17. super.onCreate(savedInstanceState);
  18. setContentView(R.layout.main);
  19.  
  20. user = (EditText) findViewById(R.id.editUser);
  21. pass = (EditText) findViewById(R.id.editPass);
  22.  
  23. login = (Button) findViewById(R.id.btnLogin);
  24.  
  25. login.setOnClickListener(new View.OnClickListener()
  26. {
  27. public void onClick(View v)
  28. {
  29. if(user.getText().toString().equals("arfhel") && pass.getText().toString().equals("gayo"))
  30. {
  31. Toast.makeText(getApplicationContext(),"Redirecting...",Toast.LENGTH_SHORT).show();
  32. }
  33. else
  34. {
  35. Toast.makeText(getApplicationContext(), "Wrong Credentials",Toast.LENGTH_SHORT).show();
  36. }
  37. }
  38. });
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement