Android Developer Question: Download Android Developer PDF

What is lifecycle of an Activity?

Tweet Share WhatsApp

Answer:

☛ OnCreate(): This is when the view is first created. This is normally where we create views, get data from bundles etc.
☛ OnStart(): Called when the activity is becoming visible to the user. Followed by onResume() if the activity comes to the foreground, or onStop() if it becomes hidden.
☛ OnResume(): Called when the activity will start interacting with the user. At this point your activity is at the top of the activity stack, with user input going to it.
☛ OnPause(): Called as part of the activity lifecycle when an activity is going into the background, but has not (yet) been killed.
☛ OnStop(): Called when you are no longer visible to the user.
☛ OnDestroy(): Called when the activity is finishing
☛ OnRestart(): Called after your activity has been stopped, prior to it being started again

Download Android Developer PDF Read All 56 Android Developer Questions
Previous QuestionNext Question
Please explain the difference between FLAG_ACTIVITY_CLEAR_TASK and FLAG_ACTIVITY_CLEAR_TOP?Tell us what is the difference between Mobile Application Testing and Mobile Testing?