Android开发——查看拥有指定权限的应用程序
my git : https://github.com/hejiawang
如题,在Android开发中,查看拥有指定权限的应用程序有哪些,
比如,在我的应用程序中,想知道系统中,有哪些应用程序是开机启动的。
那么,只要查找出拥有开机启动权限的那些应用程序就可以了。
示例代码如下:
PackageManager pm = getPackageManager(); Intent intent = new Intent("android.intent.action.BOOT_COMPLETED"); List<ResolveInfo> infos = pm.queryBroadcastReceivers(intent, PackageManager.GET_INTENT_FILTERS); for (ResolveInfo info : infos) { String receiverName = info.activityInfo.name; String packname = info.activityInfo.packageName; System.out.println("receiver:" + receiverName + "---" + packname); //其他业务逻辑 }
相关推荐
Nostalgiachild 2020-11-13
韩伟佳 2020-10-09
wuleihenbang 2020-09-16
zzqLivecn 2020-07-09
chenjinlong 2020-06-10
yinbaoshiguang 2020-06-09
sgafdsg 2020-06-04
ustcrding 2020-06-03
chenjinlong 2020-06-03
AndroidGA 2020-06-01
安辉 2020-05-27
绿豆饼 2020-05-26
CNETNews 2020-05-26
xilove0 2020-05-12
绿豆饼 2020-05-12
ChainDestiny 2020-05-07
doomvsjing 2020-05-07
hqulyc 2020-05-05
lyccsu 2020-04-30