共用方式為


TelephonyManager.ExtraIncomingNumber Field

Definition

Extra key used with the #ACTION_PHONE_STATE_CHANGED broadcast for a String containing the incoming or outgoing phone number.

[Android.Runtime.Register("EXTRA_INCOMING_NUMBER")]
public const string ExtraIncomingNumber;
[<Android.Runtime.Register("EXTRA_INCOMING_NUMBER")>]
val mutable ExtraIncomingNumber : string

Field Value

Attributes

Remarks

Extra key used with the #ACTION_PHONE_STATE_CHANGED broadcast for a String containing the incoming or outgoing phone number.

This extra is only populated for receivers of the #ACTION_PHONE_STATE_CHANGED broadcast which have been granted the android.Manifest.permission#READ_CALL_LOG and android.Manifest.permission#READ_PHONE_STATE permissions.

For incoming calls, the phone number is only guaranteed to be populated when the #EXTRA_STATE changes from #EXTRA_STATE_IDLE to #EXTRA_STATE_RINGING. If the incoming caller is from an unknown number, the extra will be populated with an empty string. For outgoing calls, the phone number is only guaranteed to be populated when the #EXTRA_STATE changes from #EXTRA_STATE_IDLE to #EXTRA_STATE_OFFHOOK. <p class="note"> Retrieve with android.content.Intent#getStringExtra(String).

This member is deprecated. Companion apps for wearable devices should use the InCallService API to retrieve the phone number for calls instead. Apps performing call screening should use the CallScreeningService API instead.

Java documentation for android.telephony.TelephonyManager.EXTRA_INCOMING_NUMBER.

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