Advertisement
Guest User

Untitled

a guest
Oct 14th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. btnRegister.setOnClickListener(new View.OnClickListener(){
  2.  
  3.  
  4. public void onClick(View v) {
  5. String userName = editTextName.getText().toString();
  6. String email = editTextEmail.getText().toString();
  7. String password = editTextPassword.getText().toString();
  8. String confirmPassword = editTextConfirmPassword.getText()
  9. .toString();
  10.  
  11. if (userName.equals("")|| email.equals("") || password.equals("")
  12. || confirmPassword.equals("")) {
  13.  
  14. Toast.makeText(getApplicationContext(), "Field Vaccant",
  15. Toast.LENGTH_LONG).show();
  16. return;
  17. }
  18.  
  19. if (!password.equals(confirmPassword)) {
  20. Toast.makeText(getApplicationContext(),
  21. "Password does not match", Toast.LENGTH_LONG).show();
  22. return;
  23. } else {
  24.  
  25.  
  26. Toast.makeText(getApplicationContext(),
  27. "Account Successfully Created ", Toast.LENGTH_LONG).show();
  28. Intent i = new Intent(RegisterActivity.this,
  29. LoginActivity.class);
  30. startActivity(i);
  31. finish();
  32. }
  33. }
  34.  
  35. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement