When onCreate (Bundle savedInstanceState)
is called, check that savedInstanceState
is not null. As stated by onCreate :
savedInstanceState If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in onSaveInstanceState(Bundle). Note: Otherwise it is null.
See also onSaveInstanceState() which is not part of the normal lifecycle but is called before the activity is killed.
Note : if the user does A ----> B ----> C --back--> B ----> C, the second time C is created the passed bundle will be null
, as it is a new instance, not the same recreated after being killed.