I want the program to repeatedly check if the user is verified in the Firebase Authentification until it is. For example, when the user makes an account on my application, the program switches into a new activity, waits until the user is verified, then automatically continues into the next activity.
I attempted to do this using a do while
loop, but unfortunately, the program freezes and stays at a black screen. I never encountered any error messages along the way.
I tried the program with these lines of code:
EmailVerified = false;
do {
if (mAuth.getCurrentUser().isEmailVerified()) {
EmailVerified = true;
Intent intent = new Intent(VerificationEmailPage.this, MainActivity.class);
startActivity(intent);
}
} while (!EmailVerified);
Doing this caused the activity not to load, and simply turn black. It seemed as if no other code was also executed in the activity. I needed the activity to load and constantly keep checking if the user is verified, then switch to the next activity once it was.