9
我希望我的通知每天在中午12点运行。你如何用时间替换时间值?将通知设置为特定时间
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notify = new Notification(R.drawable.icon,"Its Time to Eat",when);
Context context = GrubNOWActivity.this;
CharSequence title = "Its Time to Eat";
CharSequence details = "Click Here to Search for Restaurants";
Intent intent = new Intent(context,Search.class);
PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0);
notify.setLatestEventInfo(context, title, details, pending);
nm.notify(0,notify);
似乎已经做到了,谢谢! –
但是如何在特定时间设置它?假设我想在10Pm时设置它,我该怎么做? – silverFoxA
如何将其设置为特定的一天,例如星期一至星期五,现在是晚上12点? –