title: Maintain state between activities
body: <p>My app has two activities: <code>MasterActivity</code> and <code>DetailActivity</code>.
  <code>MasterActivity</code> has two visualization modes: <em>list mode</em> and <em>map mode</em>. An action bar item toggles between them.</p>
  
  <p>I'd like to mantain the selected visualization mode when user goes into <code>DetailActivity</code> and comes back. In the beginning I used <code>SharedPreferences</code> but then user would get back his previous visualization mode even after a device boot or a long inactivity time, and that's not what I mean.</p>
  
  <p>Then I switched to <code>Bundle</code> and <code>onSaveInstanceState</code> but, when user clicks on back button of <code>DetailActivity</code>, <code>onCreate</code>'s <code>Bundle</code> is always empty so I can't restore the previous visualization mode and it always reverts to the list one.</p>
  
  <p>App uses a <code>Toolbar</code> and <code>AndroidManifest.xml</code> is configured like that:</p>
  
  <pre><code>&lt;activity
      android:name=".ui.MasterActivity"
      android:label="@string/title_activity_master"
      android:theme="@style/AppTheme.NoActionBar"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.MAIN" /&gt;
          &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
      &lt;/intent-filter&gt;
  &lt;/activity&gt;
  &lt;activity
      android:name=".ui.DetailActivity"
      android:parentActivityName=".ui.MasterActivity"
      android:theme="@style/AppTheme.NoActionBar"&gt;
      &lt;meta-data
          android:name="android.support.PARENT_ACTIVITY"
          android:value="it.returntrue.revalue.ui.MasterActivity" /&gt;
  &lt;/activity&gt;
  </code></pre>