Xamarin Android Activity Lifecycle
Xamarin Android Activity Lifecycle
Advertisements
When a user navigates through an Android App, a series of events occurs. For example, when a user launches an app, e.g., the Facebook
App, it starts and becomes visible on the foreground to the user, onCreate() onStart() onResume().
If another activity starts, e.g., a phone call comes in, then the Facebook app will go to the background and the call comes to the
foreground. We now have two processes running.
When the phone call ends, the Facebook app returns to the foreground. Three methods are called.
onStart It is called when the activity starts and becomes visible to the user.
onResume It is called when the activity starts interacting with the user. User input takes place at this stage.
onPause It is called when the activity runs in the background but has not yet been killed.
onRestart It is called after the activity has stopped, before starting again. It is normally called when a user goes back to a
previous activity that had been stopped.
onDestroy This is the final call before the activity is removed from the memory.
Previous Page Next Page
Advertisements