检测用户何时设置闹钟 Android

发布于 2024-12-16 00:44:59 字数 77 浏览 2 评论 0原文

当设备检测到用户设置了警报时,我尝试执行操作。

有谁知道我如何在代码中做到这一点?将不胜感激任何建议。

谢谢

I am trying to execute an action when the device detects that the alarm is set by the user.

Does anyone know how I can go about doing this in code? Would appreciate any advice.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吻风 2024-12-23 00:44:59

用户没有执行统一的“操作”来设置警报。将其称为“警报”甚至可能都不正确,因为警报只是另一个应用程序。用户可以使用 Android 附带的库存闹钟(我猜是在时钟应用程序中?),手机制造商可能已将自己的闹钟应用程序与手机捆绑在一起,或者用户可能已从 Android 下载了第 3 方闹钟应用程序市场。

我猜想所有这些不同的应用程序唯一的共同点是它们以某种方式可以使用 AlarmManager 类来控制闹钟何时响起。但我不认为这是你可以听的东西(除了闹钟应用程序之外,还有许多其他应用程序也使用 AlarmManager)。

There isn't a unified "action" the user performs that will set the alarm. It would probably not even be correct to refer to it as "the alarm", because the alarm is just another application. The user can be using the stock alarm shipping with Android (in the Clock application, I would guess?), the phone manufacturer might have bundled its own alarm app with the phone, or the user might have downloaded a 3rd party alarm application from Android Market.

I would guess that the only thing all those different apps could have in common, is that they in some way could use the AlarmManager class to control when the alarm should go off. But I don't think this is something you can listen to (and it is also lots of other apps other than alarm apps that also use the AlarmManager).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文