Draw the neat diagram of Life Cycle of Android activity and explain. OR With the neat diagram describe methods of life cycle of android activity.

Subject: Mobile Computing

Difficulty: Medium

Marks: 6 Marks

1 Answer

As an activity transitions from state to state, it is notified of the change by calls to the following protected methods:

onCreate() This is the first callback and called when the activity is first created.
onStart() This callback is called when the activity becomes visible to the user.
onResume() This is called when the user starts interacting with the application.
onPause() The paused activity does not receive user input and cannot execute any code and called when the current activity is being paused and the previous activity is being resumed.
onStop() This callback is called when the activity is no longer visible.
onDestroy() This callback is called before the activity is destroyed by the system.
onRestart() This callback is called when the activity restarts after stopping it.

Taken together, these seven methods define the entire lifecycle of an enter image description hereactivity.

Please log in to add an answer.