Not sure why it wasn’t working before, but here is the code I worked with:
Declare the following outside of any method:
int YOURAPP_NOTIFICATION_ID = 1234567890; NotificationManager mNotificationManager;
Then, in the onReceive method, call the following:
mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); showNotification(context, R.drawable.icon, "short", false);
Then declare the following method:
private void showNotification(Context context, int statusBarIconID, String string, boolean showIconOnly) {
source share