Skip to content

Instantly share code, notes, and snippets.

@mladenrakonjac
Created June 5, 2018 10:06
Show Gist options
  • Save mladenrakonjac/b4cd9018cd01ef8639e91a1cbe1ab931 to your computer and use it in GitHub Desktop.
Save mladenrakonjac/b4cd9018cd01ef8639e91a1cbe1ab931 to your computer and use it in GitHub Desktop.
public void loginMethod(String name, String password){
if (isEmpty(name)) {
editName.setError("Username is empty");
return;
}
if (isEmpty(password)) {
editPasword.setError("Password is empty");
return;
}
if(!name.equals(username)) {
editName.setError("Username is incorrect");
return;
}
if(!password.equals(userpassword)) {
editPasword.setError("Password is incorrect");
return;
}
Intent intent=new Intent(MainActivity.this,Main2Activity.class);
startActivity(intent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment