For a little android project I'm making a loginscreen. I have variables, but they stay empty once I fill them in and press the button.
these are my variables:
private EditText email;
private EditText wachtwoord;
private Button loginButton;
here I fill them:
email = (EditText)findViewById(R.id.emailInput);
wachtwoord = (EditText)findViewById(R.id.wachtwoordInput);
loginButton = (Button)findViewById(R.id.loginButton);
}
}
and my method which always executes the catch code
public void login(View view)
{
try {
if(email.getText().toString() == "jolt_koens@hotmail.com" && wachtwoord.getText().toString() == "admin")
{
Toast.makeText(getApplicationContext(), "gelukt", Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(getApplicationContext(), "mislukt", Toast.LENGTH_SHORT).show();
loginButton.setEnabled(false);
}