我使用以下代码发出通知:
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
//Create your notification
int icon = R.drawable.ic_launcher;
CharSequence tickerText = " message";
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText,when);
Context context = getApplicationContext();
CharSequence contentTitle = last_notifs_array[0][2];
CharSequence contentText = "New Message";
PendingIntent pIntent = PendingIntent.getActivity(notifService.this,0, intent1,0);
notification.setLatestEventInfo(context,contentTitle,contentText,pIntent);
// Send the notification
nm.notify(HELLO_ID,notification);
但是我想在单击通知时开始一项活动。我怎样才能做到这一点?