Skip to content
Advertisement

The AlertDialog dosen’t show when activity start

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.

JavaScript

Please anyone help me. Thanks.

Advertisement

Answer

AlertDialog will be related current activity.
So If current activity disappeared, AlertDialog will be hided also. To fix this problem, you need to show AlertDialog first, and then catch dismiss event.

Here is code snippet. so you can try this method.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement