google-developer-training / android-fundamentals-apps-v2

Other
649 stars 2.63k forks source link

Android fundamentals 08.2: The alarm manager #329

Closed billkabb closed 2 years ago

billkabb commented 2 years ago

At "3.4 Check the state of the alarm" the code is not working as expected . while testing the app at android 9 virtual device after kill and reopen the app and without the notification activated the alarmUp boolean stays constantly true

billkabb commented 2 years ago

the problem seems to be that with the current code the pending intent is not canceled . i had to call notifyPendingIntent.cancel(); to really kill the pending intent