question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Alarm gone after swiping an app from recent apps

See original GitHub issue

On my device(LeTv One/Android 6):

  1. I scheduling new job
  2. check active alarms via adb shell dumpsys alarm
  3. see such intents:
Batch{7fae56f num=1 leuiTimeAlign=false start=1483824064305 end=1483824064305}:
    RTC_WAKEUP #0: Alarm{a95b27c type 0 when 2967563176917 red.kometa.steelsunset}
      tag=*walarm*:red.kometa.steelsunset/com.evernote.android.job.v14.PlatformAlarmReceiver
      type=0 whenElapsed=+17173d9h41m15s838ms when=2064-01-14 22:06:16
      window=0 repeatInterval=0 count=0 flags=0x0
      operation=PendingIntent{edbf82e: PendingIntentRecord{cedbf73 red.kometa.steelsunset broadcastIntent key.isShadow:false}}
Batch{606f705 num=1 leuiTimeAlign=false start=1483841004908 end=1483841004908}:
    RTC_WAKEUP #0: Alarm{318e35a type 0 when 2967580117519 red.kometa.steelsunset}
      tag=*walarm*:red.kometa.steelsunset/com.evernote.android.job.v14.PlatformAlarmReceiver
      type=0 whenElapsed=+17173d14h23m36s441ms when=2064-01-15 02:48:37
      window=0 repeatInterval=0 count=0 flags=0x0
      operation=PendingIntent{db939e0: PendingIntentRecord{ff45b9d red.kometa.steelsunset broadcastIntent key.isShadow:false}}
  1. close app via swiping it from recent apps
  2. check active alarms via adb shell dumpsys alarm
  3. scheduled Intents are gone

The same situation with AlarmManager: stackoverflow

Some other apps from google play schedule their notifications without any problems. What’s the trick? Is it expected behavior?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:19

github_iconTop GitHub Comments

19reactions
tsirolnikcommented, Jul 25, 2018

I would like to comment and say this - I’ve tried to schedule a Service class using Android’s AlarmManager but it failed miserably.

After switching for a Service to a BroadcastReceiver it did work. I’m not sure what’s the specific reason but I want to think that maybe the service is running in the background and therefore AlarmManager doesn’t start another instance of the service.

Here’s my current, working, code -


        Intent serviceIntent = new Intent(this, <BroadcastReceiver>.class);
        PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, serviceIntent, 0);
        AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
        alarm.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 1000*60, pendingIntent);

This will send a broadcast every minute.

1reaction
AndroidDeveloperLBcommented, Feb 23, 2020

Say, I have a similar issue with AlarmManager. On Pixel 4 (or emulator) with Android 10 (or 11), I schedule it, remove from recent tasks and then it never gets triggered. How come? I reported about this to Google because to me it seems like a bug:

https://issuetracker.google.com/issues/149556385

But as opposed to what’s written here, I don’t directly open a service, but open a broadcast receiver instead.

I’ve read the entire post, and I still don’t get how to fix it. Can anyone helpe?

Read more comments on GitHub >

github_iconTop Results From Across the Web

AlarmManager: PendingIntent gone after swiping app from ...
AlarmManager : PendingIntent gone after swiping app from recent apps on some devices · set alarm via alarmManager.setAlarmClock(...) · set alarm ...
Read more >
Swipe app out of recent tasks permanently kills ... - Issue Tracker
Go back to launcher, swipe app away. Process is gone forever even though Android Applications, Running shows app as running! Again sorry for...
Read more >
Switch between open apps on iPhone - Apple Support
On an iPhone with a Home button: Double-click the Home button. To browse the open apps, swipe right, then tap the app you...
Read more >
Set, cancel, or snooze alarms - Android Help - Google Support
Snooze: To delay an alarm for 10 minutes, on your lock screen, swipe left. Stop: To stop an alarm, on your lock screen,...
Read more >
Alarmed FAQ - Yoctoville
So, be sure to avoid force-quitting Alarmed. FYI, force-quitting is when you swipe-up on an app in the list of recently used apps...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found