Hello, I have been working with MIT App Inventor for the past week now. My plan was to make an app that would remind the user that their class is starting soon (5 min before) . I have gotten all of the storage coding correct and I am currently stuck on this bug that I can not seem to fix.
When the user creates a class, its input is stored in the TinyDB and when a certain criteria matches, it will ring out the alarm and set a variable to "true". For example, If you create a class and day of the class is on Friday and the class starts at 9:30 AM the alarm will ring out at 9:25 AM. If left to ring, the alarm will ring out until the minute is over. In our example the Alarm will start at 9:25 and will keep ringing until 9:26. I have a stop alarm button when pushed, the alarm will stop playing and will set another variable to "true". Since the alarm will always play until the minute is over, I added these two variables so when both are true, the alarm will not be played.
The bug is when the user leaves the classes page, (where the alarm function and the stop alarm page is) and goes to another page or has the app minimized. The alarm will play just fine, but when the user goes into the classes page to stop the alarm, the button does not do anything and the alarm will keep on ringing. It will not stop until the minute is over.
I have tried everything that I could think of but nothing would work. If anyone has a solution to my problem you can look in my code and see what is wrong and how can I fix it. Alternatively, if you have a different way the alarm logic should work, please let me know. Thanks!