Mani
Mani

Reputation: 2649

Android Activity LifeCycle: Workload on onResume(), onStart(), onPause() and onStop()

What operations can be done under all states of lifecycle and How to effectively use the callbacks of activity lifecycle?

For example, initialization of views can be done in onCreate(), animation can be started in onResume().

Upvotes: 0

Views: 6981

Answers (2)

Dharmendra
Dharmendra

Reputation: 33996

This is the best tutorial for reading the life-cycle of Android.

http://developer.android.com/guide/topics/fundamentals/activities.html#ImplementingLifecycleCallbacks

see the figure1 and figure2 this will help you a lot for understand life-cycle of Android.

Upvotes: 1

Ken
Ken

Reputation: 1558

Try reading this if you haven't already: http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle

One thing I definitely suggest if you are using cursors or simplecursoradapters in your applications is to close the cursors and detach the cursors from your adapters in the onpause, and then reattach them in the onresume method

Upvotes: 0

Related Questions