The application has 2 actions, A and B.
A has instance data stored
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt("foo", 0); }
and A has
int bar; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
for data recovery.
In action B, the action bar and
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getActionBar().setDisplayHomeAsUpEnabled(true);
to enable navigation. A is also indicated as the parent activity of B in AndroidManifest.xml .
When a user moves from A to B onSaveInstanceState , and if they return to A using the active back button, A correctly restores the saved information.
However, when the user navigates from A to B onSaveInstanceState , and then the navigation is used up to return to onCreate(Bundle savedInstanceState) , null is transmitted, even though the information has been saved.
How do I navigate to pass the package created on onSaveInstanceState ?
android android-activity android-actionbar
Gdanger
source share