0

I have an activity that shows a message custom dialog class (which inherits from Dialog) alerting the user if there has been a timeout or power loss on the device. The activity also makes calls to the alarm manager to schedule tasks.

If the dialog is showing, does it prevent the alarm manager from sending broadcasts? I looked at this answer, and I am still not sure. The official Google documentation says that a dialog retains focus and can interrupt the rest of the code. I also have a couple of handlers running on this activity, too. Does the appearance of a dialog stop the execution of them?

Community
  • 1
  • 1
Kristy Welsh
  • 7,828
  • 12
  • 64
  • 106

1 Answers1

2

If the dialog is showing, does it prevent the alarm manager from sending broadcasts?

No, unless you are somehow tying up the main application thread in the dialog, in which case you will crash with an Application Not Responding (ANR) anyway.

Does the appearance of a dialog stop the execution of them?

Similarly, those should still be working. Dialogs are event-driven. They are modal from the user standpoint (the user cannot interact with your underlying activity), but they are not blocking (show(), or the equivalent, returns control immediately to you).

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491