Hi i got stock in this point wherein \"setLatesEventInfo\" has an error. i know that setLatestEventInfo doesnt run on API 23 and up. can someone help me on how to make this
Now you have to generate your notification like this
NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder nBuilder = new NotificationCompat.Builder(context);
// set intent so it does not start a new activity
Notification notification = builder
.setContentIntent(yourPendingIntent)
.setSmallIcon(icon)
.setWhen( System.currentTimeMillis();)
.setContentTitle(title)
.setContentText(message).build();
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(notifId, notification);