Top "Android-lifecycle" questions

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

AsyncTask will always run even if app is destroyed?

I have an application and because you can't do network operations on the main thread I'm using AsyncTask, so the …

android android-asynctask android-lifecycle
What is the correct order of calling superclass methods in onPause, onStop and onDestroy methods? and Why?

I was just going through the Android Developer Site, refreshing on the Activity Life cycle, and in each code example, …

java android android-lifecycle
Prevent activity from being destroyed as long as possible

I have an app, a single activity app with fragments in it. The usual use case for this app is, …

android android-activity fragment android-lifecycle
Properly skip login activity if already logged in

My launcher icon currently starts the login activity. I've stored the logged in status in SharedPreferences. Is there any way …

android android-activity android-lifecycle android-launcher
onCreate(Bundle savedInstanceState) in always null

I know, this question is asked before on stackoverflow, but non of the answers worked for me. Probably worth mentioning: …

android android-lifecycle activity-lifecycle
android: when to use onStart(), onStop()?

I've read several posts that describe the difference between onStart() and onResume(): onStart() is called when the activity becomes visible, …

android android-lifecycle
Android checking whether the app is closed

I have an android application i need one function or any broadcast receiver that can check if the app is …

android android-activity android-lifecycle android-activitymanager
Leaving android app with back button

I want the users of my android app to leave my app when they press back at a certain activity. …

android back android-lifecycle
How to retrieve onSaveInstanceState() bundle in onResume()?

I am having a problem related to saving my Activity state. I searched and read about lots of questions here …

android android-activity android-lifecycle
Prevent multiple instances of my Android application composed of a single activity

I have an Android application which is composed from a single Activity. How can I assure that only one instance …

android android-activity android-lifecycle