修改Android上另一个应用程序的通知

发布于 2024-09-15 16:12:53 字数 177 浏览 2 评论 0原文

我试图找出是否可以从我自己的应用程序修改另一个应用程序(三星的日历应用程序)的通知。具体来说,我想将日历事件的闹钟从一次性声音(如果手机设置为振动,则为无声)更改为重复振动。

我什至可以修改属于不同应用程序的通知吗?

如果我不能,我的应用程序是否可以收到有关所有通知的通知,然后重新抛出我自己的修改后的通知?

I'm trying to find out if it is possible to modify the notification of another app (the calendar app from Samsung) from my own app. Specifically I'd like to change the alarm for a calendar event from a one-time sound (which is silent, if the phone is set to vibrate) to a repeating vibrate.

Can I even modify the notifications belonging to a differnt app?

If I can't, could my app get notified about all notifications and just rethrow my own, modified notifications?

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

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

发布评论

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

评论(1

溺ぐ爱和你が 2024-09-22 16:12:53

您可能无法更改该应用程序的通知,因为您必须直接修改触发通知的应用程序代码。

对于你的第二个问题:如果日历应用程序通过 意图 进行通信,您可以创建一个注册所需意图的应用程序(通过意图过滤器)。当日历应用程序触发适当的意图时,您将看到一个对话框,让您在可以接受它的应用程序之间进行选择,您的应用程序也应该出现在其中。在同一对话框中,您可以将应用程序设置为默认应用程序,然后正确处理数据通知。

假设而言,因为最终这取决于上述三星日历应用程序的实现方式。

You probably won't be able to change the notifications of that app because you'd have to modify the app's code directly, where the notification is being fired.

To your second question: If the calendar app communicates over intents, you could create an app which registers on the desired intent (through an Intent filter). When the appropriate intent is fired by the calendar app, you would see a dialog which lets you choose between the applications which can accept it, where also yours should appear. At the same dialog you could then set your app as the default and then handle the notification of the data properly.

Hypothetically, because in the end it depends on how the mentioned Samsung calendar app has been implemented.

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