android-lifecycle
Android DialogFragment disappears after orientation change
Okay, so the issue seems to be with the DialogFragment compatibility library. The issue was described in this post. “An obsolete DISMISS message for the fragment is retained in the message queue. It’s been queued by DialogFragment.onDestroyView() when dismissing the old dialog and gets reactivated after creating the new dialog. A quick (and possibly dirty) … Read more
fragment lifecycle: when “ondestroy” and “ondestroyview” are not called?
Take a look at this question: Why implement onDestroy() if it is not guaranteed to be called? Basically, onDestroy() is only guaranteed to be called if you call finish(). Otherwise, onDestroy() may not be called until the system deems it necessary. You might want to look at putting your “closing” logic in the onPause() or … Read more
Android – While switching between two activities, the calling order of lifecycle methods of Activity
Suppose There are two activities FirstActivity and SecondActivity. Then this order will always remain same everytime. // when you start FirstActivity (1) OnCreate() -> OnStart() -> OnResume() of FirstActivity will be called when you start SecondActivity using startActivity(new Intent(FirstActivity.this, SecondActivity.class)) (2) OnPause() of FirstActivity will be called and then (3) OnCreate() -> OnStart() -> OnResume() … Read more
Android – Performing stop of activity that is not resumed
One Line: It seems some of your activity variables were freed from memory as Android OS needed memory for the Facebook application. Explanation: When an application in foreground needs more memory than that is available, Android frees some memory from the apps that are running in background. Foreground tasks always have higher priority than background … Read more