In your Activity, you can call isFinishing()
(which can tell you if the Activity is in the process of finishing) or isDestroyed()
(which can tell you if the Activity is invalid). Please note that isDestroyed
can only be called if you are using API 17 or above.
For the official references, you can see here: http://developer.android.com/reference/android/app/Activity.html#isDestroyed() http://developer.android.com/reference/android/app/Activity.html#isFinishing()