Top "Activity-lifecycle" questions

Activities in the system are managed as an activity stack.

How do you build an Android back stack when an activity is started directly from a notification?

I have two activities: Activity A - list of items Activity B - detail view of an item Normally, a …

android android-activity activity-lifecycle
Android View - What is automatically saved and restored in an Activity

I am a beginner with Android. In Android, some generic elements can be automatically saved/restored in onSaveInstanceState/onRestoreInstanceState. For …

android activity-lifecycle android-savedstate
Difference between persistent and non-persistent data

onPause() should be used to save persistent data and onSaveInstanceState(Bundle) is typically used to save non-persistent data.What does …

android android-activity persistence activity-lifecycle
Should I manually close HandlerThreads created by my application when destroying the activity?

My app is composed of a single Activity. In this activity, I'm creating multiple HandlerThreads which run in a loop …

android activity-lifecycle android-handler
How to clear activity stack trace on back press event?

I have created an application that has multiple pages and navigation from one to another represents a crucial flow. I …

android android-activity activity-lifecycle
IllegalArgumentException with Otto Event bus in Fragment instance

I am using Otto Event bus to subscribe to certain events in a ListFragment. The bus instance is stored and …

android android-fragments activity-lifecycle otto fragment-lifecycle
Which actions does the back button/back key on Android trigger?

I am really confused. I have read that the back button calls onDestroy() can close up your currently-running activity calls …

android button android-activity back-button activity-lifecycle
android - There is no default constructor for ArrayAdapter

I m making adapter to adapt my book collection to be visible in list view. Issue is solved if I …

android android-lifecycle oncreate onpause activity-lifecycle
"persistent state" vs. "current state"

Attempting to decide (for my application) what to save in onPause() and what to save in onSaveInstanceState(), I combed the …

android android-activity onpause activity-lifecycle application-state
Why would Application sometimes restart on killProcess?

Ordinarily, exiting my application by calling: android.os.Process.killProcess(android.os.Process.myPid()); performs well without incident. But every …

android android-activity activity-lifecycle android-windowmanager