如何让所有的BroadcastReceiver(S)注册了一个特定意图的名单? [英] How to get list of all BroadcastReceiver(s) registered for a specific intent?
问题描述
我在开发操作系统级的机器人服务。 (不是从SDK,它从Android的源$ C $ C,这将是我的自定义ROM的一部分。我可以囤自己作为根)
I am developing an android service at OS level. ( not from SDK, its from android source code. It will be part of my custom ROM. I can tun myself as root)
我会给出一个接口,应用程序使用我的自定义的意图做一些事情。最后我想知道是谁所有正在听这个意图。
I am going to give an interface to apps to do something using my custom intent. At the end I want to know who all are listening for this intent.
有没有办法让所有已登记的特定意图的BroadcastReceiver(S)的名单?
Is there any way to get list of all BroadcastReceiver(s) registered for a specific intent?
感谢您的帮助!
推荐答案
使用<一个href="http://developer.android.com/reference/android/content/pm/PackageManager.html#queryBroadcastReceivers%28android.content.Intent,%20int%29"><$c$c>PackageManager$c$c>和 queryBroadcastReceivers()
。
这篇关于如何让所有的BroadcastReceiver(S)注册了一个特定意图的名单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!