Top "Android-lifecycle" questions

Questions regarding the events forwarded by the system to components, during their lifetime, in an Android Application.

Activity life cycle methods : onPostResume significance

Official documentation about Activity lists out 7 life cycle methods. onPostResume() was not quoted as life cycle method. But I feel …

android android-activity android-lifecycle
Stop handler after the fragment has been destroyed

I have a Fragment which sets up a ListView and creates a Handler to update the Listview periodically. However, it …

android listview android-fragments android-lifecycle fragment-lifecycle
In Activity.onCreate(), why does Intent.getExtras() sometimes return null?

This was probably a false alarm, see my own answer. Original question below: An activity has a button that takes …

java android android-intent android-activity android-lifecycle
Android beginner: onDestroy

Shall I place commands before or after super.onDestroy() when overwriting an activity's ondestroy? protected void onDestroy() { //option 1: callback before …

android android-lifecycle destroy
Android scenario where ondestroy() is called without onpause() or onstop()

A few days back I was asked to write down scenarios where ondestroy() is called without onpause() or onstop() being …

android android-activity android-lifecycle
Android DialogFragment disappears after orientation change

I have a FragmentActivity support v4 class which implements two side by side (kind of like gmail) fragments and a …

android android-fragments android-lifecycle android-dialogfragment
Activity did not call finish? (API 23)

I am getting the following error and i have no clue as to why its happening. Error: 08-23 17:07:46.533 22454-22454/com.…

android runtime-error android-lifecycle android-6.0-marshmallow
Public static variables and Android activity life cycle management

According to the documentation the Android OS can kill the activity at the rear of the backstack. So, say for …

java android static android-activity android-lifecycle
What is lifecycle observer and how to use it correctly?

I have read about new architectural components in Android. So, i wanted to ask what are lifecycle observers and why …

java android mvvm android-lifecycle android-livedata
Android: finishAffinity() vs finishAndRemoveTask()

TLDR: What is the difference between finishAffinity() and finishAndRemoveTask()? I am working on an Android app that has one single …

android android-fragments android-lifecycle