Udostępnij za pośrednictwem


TelephonyCallback.ICallStateListener.OnCallStateChanged(Int32) Method

Definition

Callback invoked when device call state changes.

[Android.Runtime.Register("onCallStateChanged", "(I)V", "GetOnCallStateChanged_IHandler:Android.Telephony.TelephonyCallback/ICallStateListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=31)]
public void OnCallStateChanged (int state);
[<Android.Runtime.Register("onCallStateChanged", "(I)V", "GetOnCallStateChanged_IHandler:Android.Telephony.TelephonyCallback/ICallStateListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=31)>]
abstract member OnCallStateChanged : int -> unit

Parameters

state
Int32

the current call state

Attributes

Remarks

Callback invoked when device call state changes.

Reports the state of Telephony (mobile) calls on the device for the registered subscription.

Note: the registration subscription ID comes from TelephonyManager object which registers TelephonyCallback by TelephonyManager#registerTelephonyCallback(Executor, TelephonyCallback). If this TelephonyManager object was created with TelephonyManager#createForSubscriptionId(int), then the callback applies to the subscription ID. Otherwise, this callback applies to SubscriptionManager#getDefaultSubscriptionId().

Note: The state returned here may differ from that returned by TelephonyManager#getCallState(). Receivers of this callback should be aware that calling TelephonyManager#getCallState() from within this callback may return a different state than the callback reports.

Java documentation for android.telephony.TelephonyCallback.CallStateListener.onCallStateChanged(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