The intent doesn’t make the alert dialogue show

  android, android-alertdialog, android-intent, java

This is my first time asking for help here.
Basically the problem is that I want to show an AlertDialog and then start an activity with an intent. The problem is that the intent starts without showing the AlertDialog and I don’t get why. But if I delete the intent code the alert shows up.

if (userImp == null) {
    AlertDialog alert = builder2.create();
    alert.show();
    LAUNCH_ACTIVITY=0;
    Intent intent = new Intent(User.this, Credenziali.class);
    startActivity(intent);
}

Please anyone help me. Thanks.

Source: Android Questions

LEAVE A COMMENT