title: Android BroadcastReceiver Not being called after app closed from Running App List
body: <p>In attempting to implement notifications in an android app, I am seeing that the notifications no longer work if a user closes the app from the Running App List (top swipe down and then horizontal swipe - not force quit which properly would shut down all future invocations as per google specs).  Using the back button sometimes causes the same behaviour, though not always.</p>
  
  <p>My understanding from everything that I have researched is that only a force stop by the user should stop the Broadcast Receiver from being invoked.</p>
  
  <p>Here is the relevant code and settings from the Android Manifest, note that all works fine when the app is open or left via the home button.  </p>
  
  <p>Android Manifest Relevant Sections:</p>
  
  <pre><code>&lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  
      &lt;receiver
          android:name="mypackage.android.gcm.GCMBroadcastReceiver"
          android:permission="com.google.android.c2dm.permission.SEND"
          android:exported="true"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
              &lt;category android:name="mypackage.android" /&gt;
          &lt;/intent-filter&gt;
          &lt;intent-filter&gt;
              &lt;action  android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
              &lt;category android:name="mypackage.android" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
      &lt;service
          android:name="mypackage.gcm.GCMIntentService"
          android:stopWithTask="false"
          android:exported="false"&gt;
      &lt;/service&gt;
  </code></pre>
  
  <p>Here is my class that overrides <code>WakefulBroadcastReceiver</code>:</p>
  
  <pre><code>public class GCMBroadcastReceiver extends WakefulBroadcastReceiver {
  
  @Override
  public void onReceive(final Context context, final Intent intent) {
      try {
          // Explicitly specify that GcmIntentService will handle the intent.
          ComponentName comp = new ComponentName(context.getPackageName(),  GCMIntentService.class.getName());
          // Start the service, keeping the device awake while it is launching.
          startWakefulService(context, (intent.setComponent(comp)));
          setResultCode(Activity.RESULT_OK);
      } catch(Exception e) {
          //Log it, and move on
          Log.d("GCMBroadcastReceiver", "onReceive", e);
      }
  }
  </code></pre>