I have a notification service in which a notification is created in start method of the service..the intent is directed towards actvityA...I am not clear about the activity nd service binding process..in activityA I want a method to execute that checks the notification and on successful execution of that method..the notification is cancelled..I have red many posts which say notification control isnt possible..Plz help with some to check notification recieving..Thanks in advance..
nm =(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Log.d("nm", "nm created");
Intent in=new Intent(UpdateService.this,ActivityA.class);
TaskStackBuilder.create(UpdateService.this);
stackBuilder.addParentStack(ActivityA.class);
stackBuilder.addNextIntent(in);
PendingIntent pi =stackBuilder.getPendingIntent( 0,PendingIntent.FLAG_UPDATE_CURRENT);
notification =new NotificationCompat.Builder(UpdateService.this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("Some Update")
.setContentText("Question");
notification.setContentIntent(pi);
notification.setAutoCancel(true);
int id=100;
int numMessages = 0;
notification.setContentText("You have unread messages..")
.setNumber(++numMessages);
nm.notify(id, notification.build());
stopSelf();
.i for got to mention..there is a dialog..that appears..On the press of positive button..notification mst get cleared...On negative..dialog will be dismissed..nd notification will remain..