語言

BluetoothHidDevice.Callback.OnConnectionStateChanged 方法

定義

當與遠端主機的連線狀態改變時,回調會被呼叫。

[Android.Runtime.Register("onConnectionStateChanged", "(Landroid/bluetooth/BluetoothDevice;I)V", "GetOnConnectionStateChanged_Landroid_bluetooth_BluetoothDevice_IHandler", ApiSince=28)]
public virtual void OnConnectionStateChanged(Android.Bluetooth.BluetoothDevice? device, Android.Bluetooth.ProfileState state);
[<Android.Runtime.Register("onConnectionStateChanged", "(Landroid/bluetooth/BluetoothDevice;I)V", "GetOnConnectionStateChanged_Landroid_bluetooth_BluetoothDevice_IHandler", ApiSince=28)>]
abstract member OnConnectionStateChanged : Android.Bluetooth.BluetoothDevice * Android.Bluetooth.ProfileState -> unit
override this.OnConnectionStateChanged : Android.Bluetooth.BluetoothDevice * Android.Bluetooth.ProfileState -> unit

參數

device
BluetoothDevice

BluetoothDevice 代表連接狀態變更的主機裝置物件。

state
ProfileState

連線狀態定義於 BluetoothProfile

屬性

備註

當與遠端主機的連線狀態改變時,回調會被呼叫。 應用程式可以假設虛擬纜線在被呼叫時 BluetoothProfile#STATE_CONNECTEDstate已建立。

Java 文件 android.bluetooth.BluetoothHidDevice.Callback.onConnectionStateChanged(android.bluetooth.BluetoothDevice, int)

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於