[英]Android Repeat notification every day
我想每天重复我的通知,我已经执行了这段代码,没有错误,但是它并没有每天重复我的通知。问题出在哪里?
NotificationCompat.Builder mBuilder = (android.support.v7.app.NotificationCompat.Builder) new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.tick)
.setWhen(Calendar.DAY_OF_WEEK)
.setContentTitle("My notification")
.setContentText("Hello World!");
Intent notificationIntent = new Intent(this, MainActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(contentIntent);
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(0, mBuilder.build());
系统杀死了进程。 您可以采取措施使其保持生命
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.