문제

I am facing some problems so as a conclusion can I get how to know current Activity is finished or not in onSavedInstanceState() ? Is there any possible solutions then let me know.

도움이 되었습니까?

해결책

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()

다른 팁

Check for onDestroy() Method, if its gets called or not.

According to android docs

The final call you receive before your activity is destroyed. This can happen either because the activity is finishing (someone called finish() on it, or because the system is temporarily destroying this instance of the activity to save space. You can distinguish between these two scenarios with the isFinishing() method.

If your onDestroy method of activity gets called your activity will be finished and no instance will be saved in the back stack.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top