Код: Выделить всё
RemoteInput remoteInput = new RemoteInput.Builder("key_add_note")
.setLabel("add note")
.build();
PendingIntent AddNotePendingIntent =
PendingIntent.getBroadcast(getApplicationContext(),
(int) txn.get_id(),
new Intent(getApplicationContext(), AddNoteBroadcastReceiver.class)
.putExtra(Constants.IntentExtras.STA_TXN_ID, txn.get_id()),
PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Action action =
new NotificationCompat.Action.Builder(R.drawable.ic_action_edit_dark,
"add note", AddNotePendingIntent)
.addRemoteInput(remoteInput)
.build();
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationUtil.MISC_CHANNEL_ID)
.setContentTitle("TEST")
.setContentText("add Note")
.setSmallIcon(R.drawable.ic_action_edit_dark)
.setAutoCancel(true)
.addAction(action);
NotificationManager notificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(123456, builder.build());

после нажатия кнопки «Добавить заметку», ввода текста и его отправки я пытаюсь отменить уведомление следующим образом:
Код: Выделить всё
notificationManager.cancel(123456);

почему это не отменяет уведомление? и как его отменить.
обновление: те же результаты, даже если есть тег с уведомлением
Подробнее здесь: https://stackoverflow.com/questions/542 ... ot-working
Мобильная версия