0
我希望能夠每週通知用戶執行任務。我知道我需要做什麼,但不知道如何去做。我需要以某種方式將註釋掉的代碼(最後一行)傳遞給AlarmManager。使用AlarmManager啓動通知
Context context = getApplicationContext();
CharSequence contentTitle = notiType+" reminder for "+projName;
CharSequence contentText = "Take your photo now!";
Intent notificationIntent = new Intent(getApplicationContext(), ProjectPreview.class);
notificationIntent.putExtra("projname", "asdsad");
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), contentIntent);
//mNotificationManager.notify(1, notification);
有人能幫助我嗎?