title: Activity not visible in Recents when app is in background
body: <h3>Issue description</h3>
  
  <p>In one of my apps I am seeing quite odd behaviour: when my app is running in foreground (is top-most one), then I can see its activities in system's Recents. But as soon as I put it into background, the same activity (i.e. <code>AccountsActivity</code>) that was listed moments ago is no longer present in Recents. Related portion of my Manifest file:</p>
  
  <pre><code>&lt;application
      android:name=".WebnetApplication"
      android:allowBackup="false"
      android:allowClearUserData="true"
      android:hardwareAccelerated="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
  
      &lt;activity
          android:name=".StartActivity"
          android:alwaysRetainTaskState="true"
          android:excludeFromRecents="true"
          android:label="@string/app_name"
          android:theme="@android:style/Theme.NoDisplay" &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=".AccountsActivity"
          android:excludeFromRecents="false"
          android:launchMode="singleTask"
          android:windowSoftInputMode="adjustResize" /&gt;
  
      ...
  </code></pre>
  
  <h3>Findings</h3>
  
  <p>Since this is the only app of mine that misbehaves that way, I checked all styles, and my <code>WebnetActivity</code> and <code>WebnetApplication</code> to ensure I do not call anything that could influence Recents. There's nothing like this. </p>
  
  <p>Then I started to strip down Manifest file to see if something would change. And as expected, the culprit lurks there, still it's no really clear for me why. At start, <code>AccountsActivity</code> entry in Manifest had no <code>android:excludeFromRecents</code> entry at all - this resulted in <code>AccountsActivity</code> being not visible in Recents at all. When I added <code>android:excludeFromRecents="true"</code> then the activity becomes visible in Recents, but only when it was in front. When I moved to back, then it disappeared from Recents. When I remove <code>android:excludeFromRecents="true"</code> from <code>StartActivity</code> declaration, then <code>AccountsActivity</code> become visible in Recents regardless app is in front or in background and I can remove <code>android:excludeFromRecents</code> from its entry completely without any problems as well.</p>
  
  <h3>Question</h3>
  
  <p>At the moment I am bending my head trying to understand why it all behaves that way - is it normal (and I do not know something) or it is perhaps rather bug in framework? Anyone faced similar issue and can share experience, ideas or explanation?</p>