Google 致力于为黑人社区推动种族平等。查看具体举措

ContentProviderCompat

public final class ContentProviderCompat
extends Object

java.lang.Object
   ↳ androidx.core.content.ContentProviderCompat


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

Summary

Public methods

static Context requireContext(ContentProvider provider)

Returns NonNull context associated with given ContentProvider.

Inherited methods

Public methods

requireContext

public static Context requireContext (ContentProvider provider)

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

Parameters
provider ContentProvider: The ContentProvider.

Returns
Context The Context object associated with the ContentProvider.