• +91 9723535972
  • info@interviewmaterial.com

Android Interview Questions and Answers

Question - Please explain the lifecycle of an Activity?

Answer -

Android is an open-source operating system that can be useful for many tasks. An android application will undergo various states that are associatively called as Android Activity Life Cycle.

The lifecycle of activity consists of 7 methods:-

  1. onCreate() - The function onCreate() is called When a user first opens an activity that acts the same as a constructor of a class. 
  2. onStart() - The function onStart() is called when an activity becomes visible to the user and is called after onCreate.
  3. onResume() - The function onResume() is called just before the user starts interacting with the application.
  4. onPause() - The function onPause() is called when the app is partially visible to the user on the mobile screen.
  5. onStop() - The function onStop() is called when the activity is no longer on the activity stack and not visible to the user.
  6. onRestart() - The function onRestart() is called when the activity in the stopped state is about to start again.
  7. onDestroy() - The function onDestroy() is  called when the activity is cleared from the application stack.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners