Advertisement
Guest User

Untitled

a guest
Nov 29th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. public class ButtonHandler implements View.OnClickListener{
  2. public void onClick(View v) {
  3. userName = (EditText) findViewById(R.id.UserName);
  4. String userNameStr = userName.getText().toString();
  5.  
  6. password = (EditText) findViewById(R.id.Password);
  7. String passwordStr = userName.getText().toString();
  8.  
  9. Boolean loginResult = dbManager.loginValidation(userNameStr, passwordStr);
  10.  
  11. if(loginResult){
  12. Intent viewIntent = new Intent (MainActivity.this, ViewEvent.class);
  13. this.startActivity(viewIntent);
  14. }
  15. else{
  16. Toast.makeText( MainActivity.this, "Username or Password is wrong", Toast.LENGTH_LONG).show();
  17. userName.setText("");
  18. password.setText("");
  19. }
  20.  
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement