2

I have a problem in alarm manager with kitkat version when the device in sleeping mode.

The alarm does not waking up the device >>> When I connect to wifi or charging the battery everything work fine

Any suggestions ..

My alarm manager

AlarmManager.setExact(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis() + newTimeInterval,
PendingIntent);
captainsac
  • 2,484
  • 3
  • 27
  • 48

2 Answers2

0

Try to use this. It will Help you

My alarm manager AlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, System.currentTimeMillis() + newTimeInterval, PendingIntent);
Rishi Paul
  • 936
  • 2
  • 8
  • 25
0

If your device has a "stamina mode" like most newer Sony's does and this mode is activated the AlarmManager will not work as intended. The "setExact" method will basicly work as "set" and the pending intents will first be delivered when the device is turned back on by the user. You can avoid this behaviour by disabling stamina mode or by adding your app to the stamina modes whitelist (a list of apps that are allowed to run during stand by). I have had no success in finding a programmatical sollution to the "issue".

DenDev
  • 11
  • 1
  • 2