I am using the showDialog() and dismissDialog() to show progress dialogs in my app. Moved from creating the dialog and calling show()
I wasted over a day on a problem like this with dialogs not being dismissed when calling dismissDialog. It occurred after my first screen rotation and never worked afterwards. I had been using an external AsyncTask which was passed a referenced to the state explicitly.
In the end the solution was really simple.... removeDialog(int) instead of dismissDialog(int).
I had spent what felt like forever proving to myself I was doing the dismiss on the correct activity and checking the number of times things were called etc, but it was caused by some of the jiggerypokery behind the scenes.