相关疑难解决方法(0)

将通知设置为特定时间

我希望我的通知每天中午12:00运行.如何用时间替换when值?

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);
Run Code Online (Sandbox Code Playgroud)

android android-notifications

9
推荐指数
1
解决办法
4万
查看次数

标签 统计

android ×1

android-notifications ×1