Android Developer Question:
Download Questions PDF

What is lifecycle of an Activity?

Android Developer Interview Question
Android Developer Interview Question

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 Interview Questions And Answers PDF

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?