Up navigation and saved instance data
问题 An app has 2 activities, A and B. A has instance data that is saved @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); // ... if (savedInstanceState != null) { bar = savedInstanceState.getInt("foo"); } else { bar = -1; } } to restore the data. Activity B has the actionbar enabled and @Override public void onCreate