列出所有 Content Provider Uri
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String text = "";
PackageManager pm = getPackageManager();
List<PackageInfo> packageGroup = pm.getInstalledPackages(PackageManager.GET_PROVIDERS);
for (PackageInfo info : packageGroup) {
ProviderInfo[] providers = info.providers;
if (providers == null) {
continue;
}
for (ProviderInfo provider : providers) {
text += "content://" + provider.authority + "\n";
}
}
TextView v = new TextView(this);
v.setText(text);
setContentView(v);
}
}