4
我嘗試創建多個通知。如果點擊通知,它會將 鏈接到其他活動。在下面的代碼後,它會創建兩行通知。 但是,當我點擊通知的第一行時,它不起作用。 只有第二個作品。第二個通知不起作用
for (int i = 0; i < missionName.size(); i++) {
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
final Notification notifyDetails = new Notification(R.drawable.icon,
"Mission Completed, Click Me!", System.currentTimeMillis());
notifyDetails.defaults |= Notification.DEFAULT_SOUND;
notifyDetails.defaults |= Notification.DEFAULT_VIBRATE;
Context context = getApplicationContext();
CharSequence contentTitle = missionName.get(i) + " is completed";
CharSequence contentText = "Please click to view the mission";
Intent notifyIntent = new Intent(getApplicationContext(),MissionMap.class);
notifyIntent.putExtra("missionName", missionName.get(i));
PendingIntent intent = PendingIntent.getActivity(ApplicationMenus.this,
0, notifyIntent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
notifyDetails.setLatestEventInfo(context, contentTitle, contentText,
intent);
mNotificationManager.notify(i, notifyDetails);
}
所以,請幫我找到我的錯誤。非常感謝。
謝謝你,我知道了:)) – Yoo
走回家早,因爲你的感謝@incrediApp –
@incrediApp睡的早,因爲你 –