Udostępnij za pośrednictwem


Telephony.CarrierId.GetUriForSubscriptionId(Int32) Method

Definition

Generates a content Uri used to receive updates on carrier identity change on the given subscriptionId

[Android.Runtime.Register("getUriForSubscriptionId", "(I)Landroid/net/Uri;", "", ApiSince=28)]
public static Android.Net.Uri? GetUriForSubscriptionId (int subscriptionId);
[<Android.Runtime.Register("getUriForSubscriptionId", "(I)Landroid/net/Uri;", "", ApiSince=28)>]
static member GetUriForSubscriptionId : int -> Android.Net.Uri

Parameters

subscriptionId
Int32

the subscriptionId to receive updates on

Returns

Uri

the Uri used to observe carrier identity changes

Attributes

Remarks

Generates a content Uri used to receive updates on carrier identity change on the given subscriptionId

Use this Uri with a ContentObserver to be notified of changes to the carrier identity TelephonyManager#getSimCarrierId() while your app is running. You can also use a android.app.job.JobService to ensure your app is notified of changes to the Uri even when it is not running. Note, however, that using a android.app.job.JobService does not guarantee timely delivery of updates to the Uri.

Java documentation for android.provider.Telephony.CarrierId.getUriForSubscriptionId(int).

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