title: Cancelling a notification received in background from GCM (Android)
body: <p>I'm using Google Cloud Messaging to receive new orders into an app. I'm trying to handle cases where the same order is sent twice. I just want the second receipt to be ignored, unfortuntately when the app is in the background I dont seem to be able to cancel the notification (ie it still makes a noise and sends a message). The app works fine when in the foreground, putting cancel notification code in my GCMBrodacastreceiver doesnt seem to do anything. Am I missing something?</p>
  
  <pre><code>NotificationManager mNotify = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
  
  mNotify.cancelAll();
  </code></pre>