I have a background service running and a notification listener. I want to call the notification listener from the background service and it does not seem to work. I have be
Did you defined your services in your manifest. For notification service you need to write permission also.
if you want to show notification in that case you need to write this code also:
NotificationManager nManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
NotificationCompat.Builder ncomp = new NotificationCompat.Builder(this);
ncomp.setContentTitle("My Notification");
ncomp.setContentText("Notification Listener Service Example");
ncomp.setTicker("Notification Listener Service Example");
ncomp.setSmallIcon(R.mipmap.ic_launcher);
ncomp.setAutoCancel(true);
nManager.notify((int)System.currentTimeMillis(),ncomp.build());
or did you provide the notification access to your app? Go to your settings and check notification access to your app provided or not?