2017-01-01 142 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

系統死亡的過程。你可以採取措施保持活力