Example usage for android.content.pm PackageManager queryIntentContentProviders

List of usage examples for android.content.pm PackageManager queryIntentContentProviders

Introduction

In this page you can find the example usage for android.content.pm PackageManager queryIntentContentProviders.

Prototype

public abstract List<ResolveInfo> queryIntentContentProviders(Intent intent, @ResolveInfoFlags int flags);

Source Link

Document

Retrieve all providers that can match the given intent.

Usage

From source file:com.activiti.android.platform.provider.transfer.ContentTransferManager.java

private static void isMediaProviderSupported(Context context) {
    final PackageManager pm = context.getPackageManager();
    // Pick up provider with action string
    final Intent i = new Intent(DocumentsContract.PROVIDER_INTERFACE);
    final List<ResolveInfo> providers = pm.queryIntentContentProviders(i, 0);
    for (ResolveInfo info : providers) {
        if (info != null && info.providerInfo != null) {
            final String authority = info.providerInfo.authority;
            isMediaDocumentProvider(Uri.parse("content://" + authority));
        }/*from  w w w . j ava  2s. co  m*/
    }
}