判断是否注册某个广播

2019-07-16  本文已影响0人  华埕
Intent intent = new Intent();
intent.setAction("com.xxx.powersaving.INSTALLAPP");//广播对应的action
intent.putExtra("path", apkPath);  
PackageManager pm = context.getPackageManager();
List<ResolveInfo> resolveInfos = pm.queryBroadcastReceivers(intent, 0);
if(resolveInfos != null && !resolveInfos.isEmpty()){
    //查询到相应的BroadcastReceiver
}  
上一篇 下一篇

猜你喜欢

热点阅读