with no ut Hit Save 2,000 or more with our WOOD. Int alarmInterval = Def.pref(getApplicationContext()).getInt('alarmInterval', 30) įinal Intent intent = new Intent(getApplicationContext(), CollectorAlarmReceiver.class) įinal PendingIntent pending = PendingIntent.getBroadcast(getApplicationContext(), 0, intent, 0) ĪlarmManager alarmMgr = (AlarmManager) getApplicationContext().getSystemService(Context.ALARM_SERVICE) ĪlarmMgr.cancel(pending) // cancel others.ĪtRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()+1000,ĭef. Welcome to Fun and Profitable Clockmaking We offer the finest quartz movements.
private void scheduleAlarm() // we only need to schedule once. The code is below - the method is called by the ApplicationContext class, onCreate(). Is this a normal behavior, is there any way to avoid this and keep the alarm running after closing the application? The problem is if I open the Task Manager and force close the application, then the alarm stops from running. Even if I click on Home button (and the application is paused), the alarm still runs on its interval. I have a problem with AlarmManager, I set the code for scheduling a repeating alarm and after I run the application, the alarm runs fine.