I have an activity where I want the user to wait until email account is verified, but it is not taking the user to mainActivity once account is verified, how should I address this?
See my code below;
user.sendEmailVerification();
final Handler handler = new Handler();
final int delay = 10000; //milliseconds
handler.postDelayed(new Runnable() {
public void run() {
if (user.isEmailVerified()) {
startActivity(new Intent(VerificationEmailActivity.this, MainActivity.class));
Toast.makeText(VerificationEmailActivity.this, R.string.spend_wisely, Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(VerificationEmailActivity.this, "Check your email!", Toast.LENGTH_SHORT).show();
}
handler.postDelayed(this, delay);
}
}, delay);
}