Share via


TelecomManager.GetLine1Number(PhoneAccountHandle) Method

Definition

Return the line 1 phone number for given phone account.

[Android.Runtime.Register("getLine1Number", "(Landroid/telecom/PhoneAccountHandle;)Ljava/lang/String;", "GetGetLine1Number_Landroid_telecom_PhoneAccountHandle_Handler", ApiSince=23)]
public virtual string? GetLine1Number (Android.Telecom.PhoneAccountHandle? accountHandle);
[<Android.Runtime.Register("getLine1Number", "(Landroid/telecom/PhoneAccountHandle;)Ljava/lang/String;", "GetGetLine1Number_Landroid_telecom_PhoneAccountHandle_Handler", ApiSince=23)>]
abstract member GetLine1Number : Android.Telecom.PhoneAccountHandle -> string
override this.GetLine1Number : Android.Telecom.PhoneAccountHandle -> string

Parameters

accountHandle
PhoneAccountHandle

The handle for the account retrieve a number for.

Returns

A string representation of the line 1 phone number.

Attributes

Remarks

Return the line 1 phone number for given phone account.

Requires Permission: android.Manifest.permission#READ_SMS READ_SMS, android.Manifest.permission#READ_PHONE_NUMBERS READ_PHONE_NUMBERS, or that the caller is the default SMS app for any API level. android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE for apps targeting SDK API level 29 and below.

This member is deprecated. use SubscriptionManager#getPhoneNumber(int) instead, which takes a Telephony Subscription ID that can be retrieved with the accountHandle from TelephonyManager#getSubscriptionId(PhoneAccountHandle).

Java documentation for android.telecom.TelecomManager.getLine1Number(android.telecom.PhoneAccountHandle).

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