0
使用以下代碼,我希望通知在點擊時消失。不要開始任何活動。我怎麼做?如何不從通知開始活動
NotificationManager nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
Notification n = new Notification(R.drawable.icon, "hello", System.currentTimeMillis());
n.flags |= Notification.FLAG_AUTO_CANCEL;
Intent intent = new Intent(ctx, NotifyActivity.class);
PendingIntent i = PendingIntent.getActivity(ctx, 0, intent, 0);
n.setLatestEventInfo(ctx, "title", "content", i);
nm.notify(1, n);