ContentProviderCompat

Added in 1.3.0

public final class ContentProviderCompat


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

Summary

Public methods

static @NonNull Context

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

Public methods

requireContext

Added in 1.3.0
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.