I have application with Activity, where onSaveInstanceState()
:
@Override
protected void onSaveInstanceState(Bundle outState) {
outState.putBoolean("XXX", true);
super.onSaveInstanceState(outState);
}
Then I'm doing the steps:
- Start my application.
- Press device 'Home' button (going to Android main screen).
- Go to list of applications and press my app icon.
- My application is shown again.
I expect, that after restarting savedInstanceState
in onCreate()
will contain boolean "XXX". But savedInstanceState
is null. Why it is null?
I have tried set activity's launchMode attribute to any value ('standard', 'singleTask', 'singleTop, 'singleInstance') - it doesn't affect.