In my application, I have an Activity and some fragments (Activity works like a Controller and Fragments - like views)
In some fragments I need to show AlertDialogs and ProgressDialogs, Activity can change the current fragment.
My problem: an activity can receive broadcast messages and C2DM notifications, and when I created AlertDialog, an Activity can change a fragment, but Dialog remains. Therefore, when the user clicks on some buttons, the application crashes.
DIalogFragments works like a simple dialog.
Disable the dialog manually or check if the fragment is active? Are there any built-in tools?
source share