Activity Life Cycle For Android Application Development

Activity

In Android application development, the activity represents single screen with UI ( User Interface ) and here the given below figure represents Activity Life Cycle wich derives seven methods.

Methods of activity life cycle 

onCreate( )
onStart( )
onResume( )
onPause( )
onStop( )
onRestart( )
onDestroy( )

Activity life cycle diagram

All Methods with Description

onCreate( )

  • This method is called when the activity is created.

onStart( )

  • This method is called when activity becomes visible to the user.

onResume( )

  • This method is called when  user starts interacting with the application.

onPause( )

  • This method can't exicute any code and it doesn't receive any input wich is given by user and this method is called when the previous activity is being resumed and the current activity is being paused.

onStop( )

  • This method is called when the activity is no longer visible.

onRestart( )

  • This method is called when the activity first stopping and then restarts.

onDestroy( )

  • This method is called before the activity is destroyed by the system.















No comments:

Powered by Blogger.