android 获得监听某一广播的所有程序

对于BroadcastReceiver:
Java code
?
1
android.content.pm.PackageManager.queryBroadcastReceivers(Intent,  int )

对于Activity:
Java code
?
1
android.content.pm.PackageManager.resolveActivity(Intent,  int )

对于Service:
Java code
?
1
android.content.pm.PackageManager.resolveService(Intent,  int )

eg: 查找开机启动的组件
List list = this
    .getPackageManager()
    .queryBroadcastReceivers(
      new Intent("android.intent.action.BOOT_COMPLETED"),
      0);





你可能感兴趣的:(android)