我希望能够每周通知用户执行一项任务。我知道我需要做什么,但不知道该怎么做。我需要以某种方式将注释掉的代码(最后一行)传递给 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);
有人可以帮我吗?