Share via


ContentResolver.AcquireUnstableContentProviderClient Method

Definition

Overloads

AcquireUnstableContentProviderClient(Uri)

Like #acquireContentProviderClient(Uri), but for use when you do not trust the stability of the target content provider.

AcquireUnstableContentProviderClient(String)

Like #acquireContentProviderClient(String), but for use when you do not trust the stability of the target content provider.

AcquireUnstableContentProviderClient(Uri)

Like #acquireContentProviderClient(Uri), but for use when you do not trust the stability of the target content provider.

[Android.Runtime.Register("acquireUnstableContentProviderClient", "(Landroid/net/Uri;)Landroid/content/ContentProviderClient;", "")]
public Android.Content.ContentProviderClient? AcquireUnstableContentProviderClient (Android.Net.Uri uri);
[<Android.Runtime.Register("acquireUnstableContentProviderClient", "(Landroid/net/Uri;)Landroid/content/ContentProviderClient;", "")>]
member this.AcquireUnstableContentProviderClient : Android.Net.Uri -> Android.Content.ContentProviderClient

Parameters

uri
Uri

Returns

Attributes

Remarks

Like #acquireContentProviderClient(Uri), but for use when you do not trust the stability of the target content provider. This turns off the mechanism in the platform clean up processes that are dependent on a content provider if that content provider's process goes away. Normally you can safely assume that once you have acquired a provider, you can freely use it as needed and it won't disappear, even if your process is in the background. If using this method, you need to take care to deal with any failures when communicating with the provider, and be sure to close it so that it can be re-opened later. In particular, catching a android.os.DeadObjectException from the calls there will let you know that the content provider has gone away; at that point the current ContentProviderClient object is invalid, and you should release it. You can acquire a new one if you would like to try to restart the provider and perform new operations on it.

Java documentation for android.content.ContentResolver.acquireUnstableContentProviderClient(android.net.Uri).

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

AcquireUnstableContentProviderClient(String)

Like #acquireContentProviderClient(String), but for use when you do not trust the stability of the target content provider.

[Android.Runtime.Register("acquireUnstableContentProviderClient", "(Ljava/lang/String;)Landroid/content/ContentProviderClient;", "")]
public Android.Content.ContentProviderClient? AcquireUnstableContentProviderClient (string name);
[<Android.Runtime.Register("acquireUnstableContentProviderClient", "(Ljava/lang/String;)Landroid/content/ContentProviderClient;", "")>]
member this.AcquireUnstableContentProviderClient : string -> Android.Content.ContentProviderClient

Parameters

name
String

Returns

Attributes

Remarks

Like #acquireContentProviderClient(String), but for use when you do not trust the stability of the target content provider. This turns off the mechanism in the platform clean up processes that are dependent on a content provider if that content provider's process goes away. Normally you can safely assume that once you have acquired a provider, you can freely use it as needed and it won't disappear, even if your process is in the background. If using this method, you need to take care to deal with any failures when communicating with the provider, and be sure to close it so that it can be re-opened later. In particular, catching a android.os.DeadObjectException from the calls there will let you know that the content provider has gone away; at that point the current ContentProviderClient object is invalid, and you should release it. You can acquire a new one if you would like to try to restart the provider and perform new operations on it.

Java documentation for android.content.ContentResolver.acquireUnstableContentProviderClient(java.lang.String).

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