@artshelom

Как сделать отработку нажатия на кнопку в уведомлениях?

Написал код уведомления:
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);


Как изменить PendingIntent, чтобы при нажатию на кнопки текст ContentText менялся??
  • Вопрос задан
  • 68 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы