我使用下面的代码时启动一个服务已启动通过AlarmManager通知:如何设置通知的点击监听器?
nm = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
CharSequence from = "App";
CharSequence message = "Getting Latest Info...";
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(), 0);
Notification notif = new Notification(R.drawable.icon,
"Getting Latest Info...", System.currentTimeMillis());
notif.setLatestEventInfo(this, from, message, contentIntent);
nm.notify(1, notif);
如何设置意图为这个项目,这样当用户点击它,它会推出一定的活动?
你能举个例子吗? – yoshi24
我已经添加了相关的代码,您需要修改 – momo
另外我知道这个问题以外,有无论如何,我可以设置一个额外的通过它? – yoshi24