Presentation is loading. Please wait.

Presentation is loading. Please wait.

Activity Lifecycle Fall 2012 CS2302: Programming Principles.

Similar presentations


Presentation on theme: "Activity Lifecycle Fall 2012 CS2302: Programming Principles."— Presentation transcript:

1 Activity Lifecycle Fall CS2302: Programming Principles

2 Activity States Active (running) Paused Stopped
An active activity is visible on the screen and has the focus. This is the activity the user is interacting with. Paused A paused activity is visible on the screen but doesn’t have the focus. A paused activity can be killed when its memory is needed by the OS. Stopped A stopped activity is not visible on the screen and is likely to be killed by the system when its memory is needed. Fall CS2302: Programming Principles

3 Lifecycle Events onCreate() onStart() onResume() onPause() onRestart()
onStop() onDestroy() Fall CS2302: Programming Principles

4 Start the first Activity
onCreate onStart onResume Fall CS2302: Programming Principles

5 Start the second Activity from the first Activity
onPause SecondActivity onCreate onStart onResume onStop Fall CS2302: Programming Principles

6 Come back to the first Activity
SecondActivity onPause FirstActivity onRestart onStart onResume onStop Fall CS2302: Programming Principles

7 Summary Fall CS2302: Programming Principles


Download ppt "Activity Lifecycle Fall 2012 CS2302: Programming Principles."

Similar presentations


Ads by Google