Android AlarmManager app doesn't work when killed.

Asked 2 years ago, Updated 2 years ago, 106 views

As the title says, when the app starts,

alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis(),     pendingIntent);

If you register the alarm and the app is alive in the background or foreground, the push works normally, but if you shut down the app, the alarm does not work. Which part should I check...??

android alarmmanager

2022-09-20 19:20

1 Answers

Usually, the alarm is registered well, but the components that are placed in the folding intent often do not work properly.

Send an adb command to the emulator or device to check if the alarm is alive or dead

adb shell dumpsys alarm | grep com.your.package

adb shell dumpsys alarm | grep -B 1 -A 2 -n com.your.package

If the alarm information does not come out with this command, it is an alarm problem, and if the alarm information comes out well, it can be considered as a pending int problem.


2022-09-20 19:20

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.