共用方式為


ContentProvider Constructors

Definition

Overloads

ContentProvider()

Construct a ContentProvider instance.

ContentProvider(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

ContentProvider()

Construct a ContentProvider instance.

[Android.Runtime.Register(".ctor", "()V", "")]
public ContentProvider ();
Attributes

Remarks

Construct a ContentProvider instance. Content providers must be declared in the manifest, accessed with ContentResolver, and created automatically by the system, so applications usually do not create ContentProvider instances directly.

At construction time, the object is uninitialized, and most fields and methods are unavailable. Subclasses should initialize themselves in #onCreate, not the constructor.

Content providers are created on the application main thread at application launch time. The constructor must not perform lengthy operations, or application startup will be delayed.

Java documentation for android.content.ContentProvider.ContentProvider().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

ContentProvider(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected ContentProvider (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Content.ContentProvider : nativeint * Android.Runtime.JniHandleOwnership -> Android.Content.ContentProvider

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to