I would like to know if there is a way of using the notication bar in order to do some operations (onClick), without having an activity being launched/resumed.
for example.. let's say i raise a notifcation, and when the user press on it, then instead of take me to some activity, it invoke some regular method in my current activity/service
Is there any way to implement such a thing?
for example the current notifcation code do a standart behave onClick. running up an activity.. how will channge the code in order to invoke some method instead of an activity?
messagesManager = (NotificationManager)
context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.icon, message,
System.currentTimeMillis());
PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
new Intent(context, someActivity.class), 0);
notification.setLatestEventInfo(context, "notification", message,
contentIntent);
messagesManager.notify(R.string.noto, notification);