Udostępnij za pośrednictwem


Telephony.ServiceStateTable.GetUriForSubscriptionIdAndField Method

Definition

Generates a content Uri used to receive updates on a specific field in the ServiceState provider.

[Android.Runtime.Register("getUriForSubscriptionIdAndField", "(ILjava/lang/String;)Landroid/net/Uri;", "", ApiSince=26)]
public static Android.Net.Uri? GetUriForSubscriptionIdAndField (int subscriptionId, string? field);
[<Android.Runtime.Register("getUriForSubscriptionIdAndField", "(ILjava/lang/String;)Landroid/net/Uri;", "", ApiSince=26)>]
static member GetUriForSubscriptionIdAndField : int * string -> Android.Net.Uri

Parameters

subscriptionId
Int32

the subscriptionId to receive updates on

field
String

the ServiceState field to receive updates on

Returns

Uri

the Uri used to observe ServiceState changes

Attributes

Remarks

Generates a content Uri used to receive updates on a specific field in the ServiceState provider.

Use this Uri with a ContentObserver to be notified of changes to the ServiceState 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.ServiceStateTable.getUriForSubscriptionIdAndField(int, 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