Saturday, 26 January 2013

Application Activity Cycle

All The Instance in your Application is an Activity . For instance, when your activity starts for the first time, it comes to the foreground of the system and receives user focus. During this process, the Android system calls a series of lifecycle methods on the activity in which you set up the user interface and other components. If the user performs an action that starts another activity or switches to another app, the system calls another set of lifecycle methods on your activity as it moves into the background.Within the lifecycle callback methods, you can declare how your activity behaves when the user leaves and re-enters the activity. 
for example, you are playing a game & you got a new mail , you pause & minimize the game see the the mail & resume the game Back from the same point where you stop.



  • onCreate( )
                   This is called when your Activity is created.

  • onStart( )
                   This is called to Start your Activity.

  • onResume( )
                   This is called to resume the last saved instance state .onPause( ) method is required for calling 
          this method. 
  • onPause( )
                   This is called to pause the current instance & save the instance for restoring the state on calling 
         onResume( ) method.

No comments:

Post a Comment