Example usage for android.content.pm PackageManager resolveContentProvider

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

Introduction

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

Prototype

public abstract ProviderInfo resolveContentProvider(String name, @ComponentInfoFlags int flags);

Source Link

Document

Find a single content provider by its base path name.

Usage

From source file:Main.java

/**
 * Get the information about an app's ContentProvider.
 *
 * @param pm  The PackageManager//from  w ww.ja v a  2s .  co m
 * @param app The app
 * @return The ProviderInfo for the app's ContentProvider
 */
@Nullable
private static ProviderInfo getProviderInfo(@NonNull PackageManager pm, int app) {
    return pm.resolveContentProvider(sPackageNames[app] + ".provider", 0);
}