Using intent ACTION_SET_ALARM to allow application to set a UNIQUE alarm

好久不见. 提交于 2020-01-06 20:11:17

问题


I am attempting to write an application that automatically sets the Android default alarm based on some preset values determined by an alternate algorithm.

The alarm setting works fine using the ACTION_SET_ALARM intent, however every time I run the app, it sets a NEW alarm. I'm wondering if there is any way to instead have one unique alarm set to update every time the activity sets the alarm (so that there are not hundreds of new alarms in the Android alarm application).

I will provide code excerpts if necessary, however it seems that this question can be answered without specific examples. NOTE: I am not using the Android alarm system that is intended for informing other activities of certain events, but rather the actual Android alarm that users will utilize to wake up in the morning.

Thank you in advance for any assistance!


回答1:


It turns out that this is actually not possible given the scope of my problem. Instead, I had to work with a list of manufacturer specific alarm clocks (here) and handle each case specifically.

In the case where the user is still going to use the open source alarm, I had to remove the ACTION_SET_ALARM intent as there is currently no workaround for the redundant alarms issue. The user would have to manually delete each alarm.



来源:https://stackoverflow.com/questions/11480708/using-intent-action-set-alarm-to-allow-application-to-set-a-unique-alarm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!