title: (re) showing a singleTask activity
body: <p>I having some trouble with bringing a singletask activity back into view.</p>
  
  <p>Manifest:</p>
  
  <pre><code>&lt;activity
      android:name=".test.MyActivity"
      android:configChanges="orientation|keyboardHidden|screenSize"
      android:icon="@drawable/my_launcher"
      android:label="@string/title_activity_my"
      android:launchMode="singleTask"
      android:taskAffinity=".myTask"
      android:screenOrientation="portrait"
      android:theme="@android:style/Theme.Black.NoTitleBar" &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;
  </code></pre>
  
  <p>MyActivity Code:</p>
  
  <pre><code>Intent i = new Intent(getApplicationContext(), MyActivity.class);
  i.putExtra("blah", stuff);
  i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK); // I have tried almost every flag combo here!
  startActivity(i);
  </code></pre>
  
  <p>Scenario:</p>
  
  <p>Upon onBackPressed() the activity calls moveTaskToBack (which hides my activity).
  Upon receipt of a specific incoming event, the above intent code is called, however NOTHING happens!?! No OnNewIntent() fired, no onCreate fired...</p>
  
  <p>HOWEVER:
  If I also add a separate PendingIntent to a Notification object, it WORKS!?</p>
  
  <pre><code>    Intent notificationIntent = new Intent(getApplicationContext(),MyActivity.class);
      notificationIntent.putExtra("blah", stuff);
      notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0,
              notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
      Notification notif = new Notification(icon,text,when);
      notif.flags |= Notification.FLAG_ONGOING_EVENT;
      notif.setLatestEventInfo(getApplicationContext(), contentTitle, contentText, contentIntent);
      m_notifMgr.notify(1, notif);
  </code></pre>
  
  <p>I don't understand why it works from a PendingIntent (firing onNewIntent), but not from a direct startActivity call.</p>
  
  <p>Please advise. Thanks.</p>
  
  <p>UPDATE (<em>1</em>):</p>
  
  <p>I have simplified matters and placed the same logic into a small test app:</p>
  
  <p>Activity 'A' = singleTask, with two buttons: btnStartTimer to start a timer, and btnMoveToBack to move 'A' to back.  When the timer expires, the intent to create 'B' is called.</p>
  
  <p>Activity 'B' = plain 'hello world' screen.</p>
  
  <p>Results:</p>
  
  <p>(i) If I start the timer via btnStartTimer click, and do not press btnMoveToBack, then the intent code is called and 'B' appears. </p>
  
  <p>(ii) If I start the timer via btnStartTimer click, and DO press btnMoveToBack, then the intent code is still called (indicated by log msg) and 'B' does NOT appear -- logging shows Activity 'B' onCreate NOT called.</p>
  
  <p>Which raises the question -- can I actually get intents to be processed from an activity that is not shown?</p>