2017-01-01 106 views
0

我想每天重复我的通知,我已经做了这个代码,没有错误,但它不会每天重复我的通知... 问题在哪里?Android重复通知每天

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()); 

回答

0

系统死亡的过程。你可以采取措施保持活力