Question:Which of the following functions will return all available Content Providers? 

A 
List<ProviderInfo> returnList = new ArrayList<ProvderInfo>(); 
for (PackageInfo pack : getPackageManager().getInstalledPackages(PackageManager.GET_PROVIDERS)) { ProviderInfo[] providers = pack.providers; 
 if (providers != null) { 
  returnList.addAll(Arrays.asList(providers));
 }
} 
return returnList;
 

B 
return getContext().getPackageManager().queryContentProviders("com.google", Process.myUid(), 0);
 

C 
List<ActivityInfo> returnList = new ArrayList<ActivityInfo>(); 
for (PackageInfo pack : getPackageManager().getInstalledPackages(PackageManager.GET_RECEIVERS)) { ActivityInfo[] providers = pack.receivers; 
 if (providers != null) { 
  returnList.addAll(Arrays.asList(providers)); 
 } 
} 
return returnList;
 

D None 

+ Answer
+ Report
Total Preview: 2207

Copyright © 2024. Powered by Intellect Software Ltd