0
I would like my password to compare the email also if it does not exist, but it only does the comparison of the password , how to compare the two together ?
if (mEmail.equals(email)) {
if (mPassword.equals(password)) {
Intent intent = new Intent(LoginActivity.this, MainActivityListBooks.class);
//startActivity(intent);
//Intent ii = new Intent(LoginActivity.this, ActivityAttCad.class);
intent.putExtra("mId", id1);
intent.putExtra("mEmail", email);
intent.putExtra("mPassword", password);
intent.putExtra("mNick", nickteste);
intent.putExtra("mCellphone", cellteste);
intent.putExtra("mNome", snome);
startActivity(intent);
SharedPreferences sharedPreferences = getSharedPreferences("shared_pref_key", Context.MODE_PRIVATE);
makeText(LoginActivity.this, "Object stored in SharedPreferences", Toast.LENGTH_LONG);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("id", id1);
editor.commit();
}
else {
final Toast toast = makeText(getApplicationContext(), "Email ou senha inválido(s)", Toast.LENGTH_SHORT);
toast.show();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
toast.cancel();
}
}, 500);
}
break;
if (mEmail.equals(email) && mPassword.equals(password))
?– Isac