I am having some of the following exceptions:
java.lang.IllegalArgumentException: View not attached to window manager at android.view.WindowManagerImpl.findV
If you have an Activity object hanging around, you can use the isDestroyed() method:
Activity
isDestroyed()
Activity activity; // ... if (!activity.isDestroyed()) { // ... }
This is nice if you have a non-anonymous AsyncTask subclass that you use in various places.
AsyncTask