美文网首页
判断是否注册某个广播

判断是否注册某个广播

作者: 华埕 | 来源:发表于2019-07-16 16:36 被阅读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
}  

相关文章

网友评论

      本文标题:判断是否注册某个广播

      本文链接:https://www.haomeiwen.com/subject/uaptlctx.html