Skip to content

Instantly share code, notes, and snippets.

@javieranton-zz
Created May 12, 2020 20:41
Show Gist options
  • Save javieranton-zz/33ad9d84658ffe55ee6f2a7fb5cf5aae to your computer and use it in GitHub Desktop.
Save javieranton-zz/33ad9d84658ffe55ee6f2a7fb5cf5aae to your computer and use it in GitHub Desktop.
package com.groups;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
public class GroupsReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent arg1) {
try {
Bundle extras = arg1.getExtras();
String receiverAction = extras.getString("action");
switch (receiverAction) {
case "markNotifAsRead":
Intent dismissIntent = new Intent(context, your.namespace.GroupsJobIntentService.class);
dismissIntent.putExtras(extras);
your.namespace.GroupsJobIntentService.enqueueWork(context, dismissIntent);
break;
}
} catch (Exception ex) {
your.namespace.CN1AndroidApplication.traceError("Receiver onReceive error: " + ex.toString());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment