2016-09-11 40 views
1

使用AlarmManager類,我能夠在200毫秒(用於測試)的代碼安排通知:
結算RAM停止顯示通知

Intent alarmIntent = new Intent(this, AlarmReceiver.class); 
pendingIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, 0); 
manager = (AlarmManager)getSystemService(Context.ALARM_SERVICE); 
int interval =200; 
manager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(),interval, pendingIntent); 
public class AlarmReceiver extends BroadcastReceiver { 

@Override 
public void onReceive(Context arg0, Intent arg1) { 
    SetUpNotification.createNotification(); 

}} 

但是,當我清理RAM這些通知停止即使我關閉的活動我能夠得到這些通知,但不清除RAM後,我不知道我在做什麼錯誤請大家幫忙

+0

是這種情況發生在所有的手機? – Saveen

+0

@Saveen只在一部手機中籤到,可能我可以改變嗎? – phpdroid

+0

是的,我有問題在mi手機有問題和一個更多的手機聯想a1000也有同樣的問題 – Saveen

回答