Why is the toast message shown in this GIF disappearing before it should? I have tried displaying the toast message from the first activity (the password reset activity) right before starting the new activity (the login activity). I have also tried showing the toast message from the new activity in onResume() and it has the same effect. Also, as seen in the GIF, the toast message will reappear until it actually finishes if I tap on where it should be. EDIT: Actually, the toast message will reappear if I tap anywhere on the screen.
EDIT: Here is the code for the toast message:
auth.sendPasswordResetEmail(email)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Toast.makeText(ResetPasswordActivity.this, "We have sent you instructions to reset your password!", Toast.LENGTH_SHORT).show();
startActivity(new Intent(ResetPasswordActivity.this, LoginActivity.class));
finish();
} else {
Toast.makeText(ResetPasswordActivity.this, "Failed to send reset email!", Toast.LENGTH_SHORT).show();
}
progressBar.setVisibility(View.GONE);
}
});
I get the same problem when I use Toast.LENGTH_LONG. It disappears in the same amount of time as Toast.LENGTH_SHORT, but it lasts longer (as expected) after I tap on it again to bring it back up like I do in the GIF. The thing is, I shouldn't have to tap to make it show for the full duration.