Answer the question
In order to leave comments, you need to log in
How to make button click processing in notifications?
Wrote notification code:
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder builder =
new NotificationCompat.Builder(context)
.setAutoCancel(true)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("1-")
.setContentText("Список тем")
.addAction(R.drawable.ic_launcher_background, "Назад",pendingIntent)
.addAction(R.drawable.ic_launcher_background, "Ок",pendingIntent)
.addAction(R.drawable.ic_launcher_background, "Вперед",pendingIntent)
;
Notification notification = builder.build();
NotificationManager notificationManager =
(NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);
notificationManager.notify(1, notification);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question