I'm trying to get a complete list of which Subs are automatically run under different circumstances.
This might have already been done but I can't find it.
So far my list is as follows.
Have I got it right, and have I missed any use-cases?
This list contains errors and omissions. See later posts for better lists.
When the user first launches your app or brings it to the front after quitting
(Quitting could be by pressing the Back button or your app calling Activity.Finish.
If the user has previously run your app and the Process has not yet been killed, it will be re-used. Otherwise a new Process is created.)
Process_Globals is run.
Globals is run.
Activity_Create is run with FirstTime parameter set to True.
Activity_Resume is run.
When the user runs another app
Activity_Paused is run with the UserClosed parameter set to False.
(Android will determine when the Process ends.
If the user brings your app to the front before the Process is killed, Process_Globals will not be run.)
When the user clicks the Back button
Activity_Paused is run with the UserClosed parameter set to True.
(Android will determine when the Process ends.
The next time the app is run, Process_Globals will be run.)
When the user brings your app to front after running a different app
Globals is run.
Activity_Create is run with FirstTime parameter set to False.
Activity_Resume is run.
When the user rotates the device
Sub Activity_Paused is run with the UserClosed parameter set to False.
The screen takes on its new configuration.
Globals is run.
Activity_Create is run with FirstTime parameter set to False.
Activity_Resume is run.
When your app calls Activity.Finish
(You might have an Exit button which calls this.)
Activity_Paused is run with the UserClosed parameter set to True.
Android will determine when the Process ends.
This might have already been done but I can't find it.
So far my list is as follows.
Have I got it right, and have I missed any use-cases?
This list contains errors and omissions. See later posts for better lists.
When the user first launches your app or brings it to the front after quitting
(Quitting could be by pressing the Back button or your app calling Activity.Finish.
If the user has previously run your app and the Process has not yet been killed, it will be re-used. Otherwise a new Process is created.)
Process_Globals is run.
Globals is run.
Activity_Create is run with FirstTime parameter set to True.
Activity_Resume is run.
When the user runs another app
Activity_Paused is run with the UserClosed parameter set to False.
(Android will determine when the Process ends.
If the user brings your app to the front before the Process is killed, Process_Globals will not be run.)
When the user clicks the Back button
Activity_Paused is run with the UserClosed parameter set to True.
(Android will determine when the Process ends.
The next time the app is run, Process_Globals will be run.)
When the user brings your app to front after running a different app
Globals is run.
Activity_Create is run with FirstTime parameter set to False.
Activity_Resume is run.
When the user rotates the device
Sub Activity_Paused is run with the UserClosed parameter set to False.
The screen takes on its new configuration.
Globals is run.
Activity_Create is run with FirstTime parameter set to False.
Activity_Resume is run.
When your app calls Activity.Finish
(You might have an Exit button which calls this.)
Activity_Paused is run with the UserClosed parameter set to True.
Android will determine when the Process ends.
Last edited: