I have a question: I want make a notification in status bar. But when clicking on it, it just clears it and doesn’t launch any intent. How can I do this?
Intent intent;
intent= new Intent(myclass.this, myclass.class);
PendingIntent pi = PendingIntent.getActivity(myclass.this, 0, intent, 0);
String body = "This is a test message";
String title = "test msg";
Notification n = new Notification(R.drawable.ic_launcher, body,System.currentTimeMillis());
n.setLatestEventInfo(myclass.this, title, body, pi);
n.defaults = Notification.DEFAULT_ALL;
nm.notify(uniqueID, n);
With this code, when the notification raised and I click on it, the new intent will be created and shown. I don’t want to create any new intent. Just clear the notification.
Pass