|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); Intent notificationIntent = new Intent(this, "Your linked class"); PendingIntent pi = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_ONE_SHOT); Notification note = new Notification(R.drawable.ic_launcher, "Notification Title", System.currentTimeMillis()); note.setLatestEventInfo(this, "Title", "Description", pi); note.defaults |= Notification.DEFAULT_ALL; note.flags |= Notification.FLAG_AUTO_CANCEL; int id = Integer.parseInt(intent.getStringExtra("id")); manager.notify(id, note); |




