So I\'ve activity called GameActivity.java and in this activity I call DialogAnswer.show() which simple shows some picture on screen.
A lot of people may be googling this so I might put my 2p in:
Unfortunately the examples where people are using isShowing() aren't going to work as this can still return true when the view is detached (the activity has gone).
If you are lazy, the other posters comment about wrapping it in a try {} does also work in /most/ situations (though there are a few cases where the system may close it and an exception will still result in a force-close that you can't put a try{} round as it happens in android code, not yours)
The best solution is to close the dialogs when your activity finishes/closes. If you attempt to close it after the user navigates away whilst your async task is running (or, the phone rings and it's navigated away for them) then you're going to get the ViewNotAttached exception.