title: Android app child activity not restored after press home/task-switcher
body: <p>I have a main activity which creates a child activity when a button is pressed.</p>
  
  <p>If I press the task-manager or home button when the child activity is displayed, the child activity is destroyed, and I get onSaveInstanceState then onDestroy called (for the child).</p>
  
  <p>When I switch back to my app, the user is returned to the root activity and the child is not restored.  The only notification I receive is the main activity onResume.</p>
  
  <p>I've tried setting the alwaysRetainTaskState flag in my root activity, but doesn't help.</p>
  
  <p>Can any one offer any advice?</p>
  
  <pre><code>&lt;application
      android:name=".Application"
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
      &lt;activity
          android:name=".MainActivity"
          android:label="@string/app_name"
          android:theme="@style/AppTheme.NoActionBar"
          android:alwaysRetainTaskState="true"&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=".GameActivity"
          android:label="@string/app_name"
          android:noHistory="true"&gt;
          &lt;!--android:theme="@style/AppDialogTheme"--&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  
  public void onClickStart(View v) {
      ((Application) getApplication()).resetCurrentScore();
      ((Application) getApplication()).resetCurrentLevel();
      ((Application) getApplication()).resetLives();
  
      Integer level = ((Application) getApplication()).getCurrentLevel();
  
      if (level &lt;= 3) {
          Intent GameActivity = new Intent(getApplicationContext(), GameActivity.class);
          startActivity(GameActivity);
      }
      else {
          Intent SpellGameActivity = new Intent(getApplicationContext(), SpellGameActivity.class);
          startActivity(SpellGameActivity);
      }
  }
  </code></pre>