Android - диспетчер уведомлений с уведомлением без намерения

Я хотел бы иметь возможность запускать уведомление, чтобы предупреждать пользователей о таймере, который закончился, однако я не хочу иметь намерение, когда вы щелкаете уведомление.

Я пробовал передать значение null для намерения

String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns);

int icon = R.drawable.icon;
CharSequence tickerText = "Hello";
long when = System.currentTimeMillis();

Notification notification = new Notification(icon, tickerText, when);

CharSequence contentTitle = "My notification";
CharSequence contentText = "Hello World!";

notification.setLatestEventInfo(context, contentTitle, contentText, null);
mNotificationManager.notify(HELLO_ID, notification);
37
задан Squonk 27 April 2012 в 00:28
поделиться