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);