Does Android detect if dialogue is active?

Is there a general way to determine if dialogs currently exist? Of course, I can track all calls to createDialog and dismissDialog , but this is cumbersome.

thanks

+4
source share
1 answer

I am using this method:

 protected void showDialogSafe(int id) { if (!isFinishing()) { showDialog(id); } } 

Which I grabbed from here: http://daniel-codes.blogspot.com/2009/12/activities-and-dialogs.html

When deviating from them, I just catch the IllegalArgumentException.

Falmarri, dialogue tracking seems to be easier said than done when you have many threads. I thought my code was perfect, but I get a bunch of crash reports when my application tries to reject dialogs that don't appear, or tries to display a dialog when the action is complete.

0
source

All Articles