Fixed
Status Update
Comments
vi...@google.com <vi...@google.com>
vi...@google.com <vi...@google.com> #2
We have passed this to the development team and will update this issue with more information as it becomes available.
lb...@gmail.com <lb...@gmail.com> #3
Seems the same occurs for JobScheduler.
Attached about this too.
Attached about this too.
lb...@gmail.com <lb...@gmail.com> #4
And WorkManager, as tested from Google's own sample :
https://github.com/googlecodelabs/android-workmanager
All I changed to it is to update the dependencies, target API 29, add logs, and add a delay of 10 seconds (to let me have some time to remove the app from the recent tasks).
All I changed to it is to update the dependencies, target API 29, add logs, and add a delay of 10 seconds (to let me have some time to remove the app from the recent tasks).
lb...@gmail.com <lb...@gmail.com> #5
For AlarmManager it seems this issue started from API 27. It doesn't occur on API 26
lb...@gmail.com <lb...@gmail.com> #6
Attached sample to show a possible workaround.
The idea (written here:https://stackoverflow.com/a/60323379/878126 ) is to start a fake Activity right when the task is removed.
For some reason it works on Android 10 with SAW permission declared (not needed to be granted), but on Android R it also has to be granted. I added this permission because of this:
https://developer.android.com/guide/components/activities/background-starts#exceptions
But I suspect there could be a nicer workaround, of not starting an Activity and starting a foreground service instead, even if it's for a split of a second.
The idea (written here:
For some reason it works on Android 10 with SAW permission declared (not needed to be granted), but on Android R it also has to be granted. I added this permission because of this:
But I suspect there could be a nicer workaround, of not starting an Activity and starting a foreground service instead, even if it's for a split of a second.
lb...@gmail.com <lb...@gmail.com> #7
Attached sample of trying to use a Foreground Service instead of an Activity.
This workaround doesn't work as opposed to the Activity, sadly.
No idea why an Activity is working but not a service. I even tried to re-schedule the alarm there and tried to let the service stay for a bit, even after re-schedule.
This workaround doesn't work as opposed to the Activity, sadly.
No idea why an Activity is working but not a service. I even tried to re-schedule the alarm there and tried to let the service stay for a bit, even after re-schedule.
lb...@gmail.com <lb...@gmail.com> #8
Found another workaround:
Have a foreground service that when the app-task is removed, it closes itself.
Attached here.
Have a foreground service that when the app-task is removed, it closes itself.
Attached here.
k....@gmail.com <k....@gmail.com> #9
Can you please explain the working of this code ??
Can you please explain the role of each component in the code
1) what is the role of FakeService ??
2) what is the role of FakeActivity ??
3) When the alarm is fired, AlarmReceiver gets called and inside that why are we starting a MyService ??
Can't we put the code in MyService in AlarmReceiver itself ??
Can you please explain the role of each component in the code
1) what is the role of FakeService ??
2) what is the role of FakeActivity ??
3) When the alarm is fired, AlarmReceiver gets called and inside that why are we starting a MyService ??
Can't we put the code in MyService in AlarmReceiver itself ??
lb...@gmail.com <lb...@gmail.com> #10
@9 Those are just my attempts to overcome this issue.
In the end, I concluded that the issue occurs only if used via the IDE on some of its versions:
https://issuetracker.google.com/issues/150080941#comment5
Please try it yourself too. I believe this is the cause of it.
I hope Google will fix it though. It makes apps seem unreliable and harder to check and fix this way.
In the end, I concluded that the issue occurs only if used via the IDE on some of its versions:
Please try it yourself too. I believe this is the cause of it.
I hope Google will fix it though. It makes apps seem unreliable and harder to check and fix this way.
k....@gmail.com <k....@gmail.com> #11
I tried it on android studio version 3.6.1 It did not work. Though i launched the app from launcher, it dd not work. The following code is working only if the app is present in recent apps list, else it is not working.
alarmManager.setAlarmClock(new AlarmManager.AlarmClockInfo(System.currentTimeMillis() + 60 * 1000, null), pendingIntent);
However your work around sample code with foreground service is working great.
alarmManager.setAlarmClock(new AlarmManager.AlarmClockInfo(System.currentTimeMillis() + 60 * 1000, null), pendingIntent);
However your work around sample code with foreground service is working great.
ke...@gmail.com <ke...@gmail.com> #12
I have the same problem and this is very frustrating. I have been struggling to solve this problem for days now.
le...@googlemail.com <le...@googlemail.com> #13
Same here, I have found that if my app is run once without setting the alarm then removed from recently used list, then run the app again and set the alarm and remove from the recently used list the alarm will then fire quite happily.
sh...@gmail.com <sh...@gmail.com> #14
Same too, Why First launch alarmmanager not working when I cleared the app from the recent list?
While the Second launch perfectly works with alarmmanger whatever clear from the recent list. How can I do alarmmanager properly works in the first launch without reopening the app?
While the Second launch perfectly works with alarmmanger whatever clear from the recent list. How can I do alarmmanager properly works in the first launch without reopening the app?
lb...@gmail.com <lb...@gmail.com> #15
Just a note:
https://issuetracker.google.com/issues/150080941#comment30
On Android Studio 4.1.1, it worked fine. Only later this bug started to appear.
On Android Studio 4.1.1, it worked fine. Only later this bug started to appear.
vi...@google.com <vi...@google.com> #16
Are you still facing the issue on latest Studio version, kindly confirm.
vi...@google.com <vi...@google.com> #17
Please provide the requested information to proceed further. Unfortunately the issue would be closed within 7 days if there is no further update.
lb...@gmail.com <lb...@gmail.com> #18
@16 @17 Why do you send me tens of emails about old bugs that you could just check for yourself...
It was reported months ago...
Anyway, issue seems to still exists.
Tested on Android 12L that was published today.
See updated sample.
It didn't show the alarm in its notification.
As before, this happens only in the case of install&run from the IDE, when the app wasn't installed before.
It was reported months ago...
Anyway, issue seems to still exists.
Tested on Android 12L that was published today.
See updated sample.
It didn't show the alarm in its notification.
As before, this happens only in the case of install&run from the IDE, when the app wasn't installed before.
vi...@google.com <vi...@google.com> #19
Our development team has fixed the issue you have reported. Please feel free to open a new issue and add the relevant information along with reference to earlier issue if you encounter this issue again. Thanks
lb...@gmail.com <lb...@gmail.com> #20
@19 I can't check it because you deleted all the files I've attached here.
Please restore the files so that I could test it out.
Please restore the files so that I could test it out.
Description
- Steps to reproduce the problem (including sample code if appropriate).
1. Have an alarm clock project (attached here) that upon clicking on a button will set an alarm to be triggered in a short time. You can have it to be 10 seconds, 60 seconds or more.
2. Check that indeed it works in the case of waiting on the app itself, and when leaving it.
3. Now check when you set the alarm and remove the app from the recent tasks.
- What happened.
The alarm doesn't get triggered on the time that was set, and seems it never will be.
You can wait as long as you wish. I waited half an hour, and nothing occurred. That's even though the docs say this should work:
And the device's display was already turned on...
- What you think the correct behavior should be.
Should trigger the alarm on the time it was set to .