Android – Activity callback/hook methods PART 3

hook methods, <span>Android – Activity callback/hook methods PART 3</span>, KandZ

You can read Part 1 and Part 2.

This part will cover the 7 hook methods:

  • onCreate()It is called first when activity launched and it is called only one time. Here you initialize the views, bind data to lists etc. Next is onStart()
  • onStart()It is called when the activity is becoming visible to the user. Next is onResume() only if the activity was at the background and now comes to the foreground.
  • onResume()It is when the activity starts interacting with the user and it is at the top of its stack.
  • onPause() It is called when the user leaves the activity but still visible at the background. You should use it to perform clean up operations and commit changes. If the activity comes back to the foreground then onResume() follows or onStop() if it becomes invisible.
  • onStop()It is called when the activity is not visible anymore. onRestart() follows if the activity comes back or onDestroy() if the activity is gonna be destroyed/exited.
  • onRestart()It is called when the activity comes back after it has been stopped. Next is onStart() and onResume()
  • onDestroy() It is called before the activity is destroyed either because of you exit or because the system kills it to save memory space.

Read more here.

92040cookie-checkAndroid – Activity callback/hook methods PART 3Android – Activity callback/hook methods PART 3

Related posts

One Thought to “Android – Activity callback/hook methods PART 3

  1. […] Android – Activity callback/hook methods PART 3 […]

Comments are closed.