Is there a generic way to determine if there is dialog currently shown ? Sure, i can keep track of all createDialog and dismissDialog invocations, but that’s cumbersome.
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I use this method:
Which I grabbed from here: http://daniel-codes.blogspot.com/2009/12/activities-and-dialogs.html
When dismissing them I just catch the IllegalArgumentException.
Falmarri, keeping track of the dialogs seems to be easier said than done when you have multiple threads running. I thought my code was perfect, but I get a bunch of crash reports when my app tries to dismiss dialogs that aren’t shown or tries to display a dialog when the activity is finished.