Which activity method is called first in Android? For example viewWillAppear is called first in case of IPhone.
Also can someone tell me when I come back from an activity to previous activity, which method is called first? I don’t want to load everything again and again each time I come back to an activity.
Thanks,
Stone
When you enter your app, the life cycle flow will be like this:
onCreate() -> onStart() -> onResume()
Now if you are using an intent to move from your current Activity to the next Activity, these are the methods of the current activity that will be executed:
onPause() -> onStop()
When you come back to the same activity(e.g., using back key event), these are the methods of the current activity that will be executed:
onStart() -> onResume()
And when you exit your app, the flow goes like this:
onPause() -> onStop() -> onDestroy()