Enumerate three key loops when monitoring an activity?

Asked 21-Jan-2018
Viewed 640 times

1

Enumerate three key loops when monitoring an activity?

1 Answer


0

we can monitor an android app in these three key loops  - 

  1. Entire lifetime – An activity starts when onCreate() method is called and when the app is completely stopped when onDestroy()  method is called. The activity lifetime lies between onCreate and onDestroy method. during this phase, an app may enter into different states such as working in the background or stopped for some time.
  2. Visible lifetime – During this phase, the activity is actually visible to the user, this happens when the user is interacting with the app.  this happens between onStart and onStop.  when onStart() method is called the activity is started such as it will display some data on the screen and when the onStop() method is called the activity is stopped or is currently not visible to the user.
  3. Foreground lifetime – this is the time period when the activity loses the focus and onPause() method is called when the activity gains the focus then onResume() method is called. onPause means that the app is opened but there is no interaction is going on. example when loading two apps on the same screen  or during multitasking we are working on one activity and other  is just visible to us. this whole process takes place between onPause and onResume.