android有哪些app接收了特定的广播

List<ResolveInfo> list = this
   .getPackageManager()
   .queryBroadcastReceivers(
     new Intent("com.example.receiver"),
     0);
showResolveInfo(list);

private void showResolveInfo(List<ResolveInfo> list){
		for(ResolveInfo resolveInfo: list){
			StringBuilder builder = new StringBuilder();
			if(resolveInfo.activityInfo!=null){
				builder.append("packageName:"+resolveInfo.activityInfo.packageName);
				builder.append(",");
			}
		
			builder.append(" resolveInfo:"+resolveInfo.toString());
			Log.i(tag, builder.toString());
		}
	
	}



你可能感兴趣的:(android有哪些app接收了特定的广播)