Top "Android-lifecycle" questions

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

How to know when my app has been killed?

I need to know when the user kills my app (Force stop). I've been reading the android lifecycle, which has …

android android-lifecycle
One Activity and all other Fragments

I am thinking of implementing one screen with Activity and all other sreens with Fragments and managing all the fragments …

android android-layout android-activity android-fragments android-lifecycle
When exactly are onSaveInstanceState() and onRestoreInstanceState() called?

The following figure (from the official doc) describes the well-known lifecycle of an Android activity: On the other hand, when …

android android-activity restore android-lifecycle
Android: onDestroy() or similar method in Application class

I am extending Application class to work with some global variables that need context. I know there is onCreate() method …

android android-lifecycle
Why use Fragment#setRetainInstance(boolean)?

I find Fragment#setRetainInstance(true) confusing. Here is the Javadoc, extracted from the Android Developer API: public void setRetainInstance (boolean …

android android-fragments android-lifecycle
What is the difference between onPause() and onStop() of Android Activites?

From android doc here http://developer.android.com/reference/android/app/Activity.html, it said 'Activity comes into foreground' will …

android android-activity android-lifecycle
Is onResume() called before onActivityResult()?

Here is how my app is laid out: onResume() user is prompted to login If user logs in, he can …

android android-activity android-lifecycle activity-lifecycle
When Can I First Measure a View?

So I have a bit of confusion with trying to set the background drawable of a view as it is …

android layout height android-lifecycle
Android how to stop refreshing Fragments on tab change

I have the following code : MainActivity.java package com.erc.library; import java.io.BufferedInputStream; import java.io.File; import …

java android android-fragments android-viewpager android-lifecycle
What is the benefit of using Fragments in Android, rather than Views?

When developing for Android, you can set your target (or minimum) sdk to 4 (API 1.6) and add the android compatibility package (…

android android-fragments android-view android-lifecycle software-design