Android Open Source - fco-alerts-app Notification Delete Receiver






From Project

Back to project page fco-alerts-app.

License

The source code is released under:

MIT License

If you think the Android project fco-alerts-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package uk.co.eleusis.android.fcoalerts;
/*from  www.  j  ava2s  .  com*/
import uk.co.eleusis.android.util.DebugUtils;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
 * We need to know when a notification has been cleared, so we no longer show
 * it in the 'inbox' style when the next one comes along.
 * 
 * We could write this as a WakefulBroadcastReceiver that starts an IntentService
 * to do the actual work, but in reality it isn't going to do anything that takes
 * any time, so for now we'll keep the functionality local to this Receiver. See
 * the GCMIntent* classes for an alternative example.
 * 
 * @author keithm
 *
 */
public class NotificationDeleteReceiver extends BroadcastReceiver 
{
  private static final String TAG = "NotificationDeleteReceiver";
  
    @Override
    public void onReceive(Context context, Intent intent) 
    {
      // first off, just check that we got here
      Log.d(TAG, "received del-notif intent: ");
      DebugUtils.printIntent(intent);

      NotificationStore store = new NotificationStore(context);
      store.removeAllNotifications();
    }
}




Java Source Code List

uk.co.eleusis.android.fcoalerts.Constants.java
uk.co.eleusis.android.fcoalerts.CountryPrefs.java
uk.co.eleusis.android.fcoalerts.GCMRegistration.java
uk.co.eleusis.android.fcoalerts.GcmBroadcastReceiver.java
uk.co.eleusis.android.fcoalerts.GcmIntentService.java
uk.co.eleusis.android.fcoalerts.MainActivity.java
uk.co.eleusis.android.fcoalerts.NotificationDeleteReceiver.java
uk.co.eleusis.android.fcoalerts.NotificationForwardReceiver.java
uk.co.eleusis.android.fcoalerts.NotificationStore.java
uk.co.eleusis.android.fcoalerts.NotifiedAlert.java
uk.co.eleusis.android.fcoalerts.Notifier.java
uk.co.eleusis.android.fcoalerts.RegidChangeListener.java
uk.co.eleusis.android.fcoalerts.ServerComms.java
uk.co.eleusis.android.fcoalerts.SettingsDisplay.java