@RequiresApi(Build.VERSION_CODES.KITKAT)
    @NonNull
    public static ProviderClient getProviderClient(
            @NonNull Context context,
            @NonNull Class<? extends MuzeiArtProvider> provider) {
        ComponentName componentName = new ComponentName(context, provider);
        PackageManager pm = context.getPackageManager();
        String authority;
        try {
            @SuppressLint("InlinedApi")
            ProviderInfo info = pm.getProviderInfo(componentName, 0);
            authority = info.authority;
        } catch (PackageManager.NameNotFoundException e) {
            throw new IllegalArgumentException("Invalid MuzeiArtProvider: " + componentName
                    + ", is your provider disabled?", e);
        }
        return getProviderClient(context, authority);
    }
@ RequiresApi ( Build . VERSION_CODES . KITKAT ) @ NonNull public static ProviderClient getProviderClient ( @ NonNull Context context , @ NonNull Class < ? extends MuzeiArtProvider > provider ) { ComponentName componentName = new ComponentName ( context , provider ) ; PackageManager pm = context . getPackageManager ( ) ; String authority ; try { @ SuppressLint ( "InlinedApi" ) ProviderInfo info = pm . getProviderInfo ( componentName , 0 ) ; authority = info . authority ; } catch ( PackageManager . NameNotFoundException e ) { throw new IllegalArgumentException ( "Invalid MuzeiArtProvider: " + componentName + ", is your provider disabled?" , e ) ; } return getProviderClient ( context , authority ) ; }
Creates a new {@link ProviderClient} for accessing the given {@link MuzeiArtProvider}
from anywhere in your application.

@param context Context used to construct the ProviderClient.
@param provider The {@link MuzeiArtProvider} you need a ProviderClient for.
@return a {@link ProviderClient} suitable for accessing the {@link MuzeiArtProvider}.