ContentProviderCompat

public final class ContentProviderCompat


Helper for accessing features in android.content.ContentProvider in a backwards compatible fashion.

Summary

Public constructors

Public methods

static @NonNull Context

Returns NonNull context associated with given android.content.ContentProvider.

Public constructors

ContentProviderCompat

public final ContentProviderCompat()

Public methods

requireContext

public static @NonNull Context requireContext(@NonNull ContentProvider provider)

Returns NonNull context associated with given android.content.ContentProvider. A provider must be declared in the manifest and created automatically by the system, and context is only available after onCreate is called.

Returns
@NonNull Context

The android.content.Context object associated with the android.content.ContentProvider.