語言

BluetoothHearingAid.GetConnectionState(BluetoothDevice) 方法

定義

取得針對Build.VERSION_CODES應用程式的設定檔目前連線狀態。若為 S 或更高,則需取得 Manifest.permission.BLUETOOTH_CONNECT 權限,可透過 android.app.Activity.requestPermissions(String[],int)取得。

[Android.Runtime.Register("getConnectionState", "(Landroid/bluetooth/BluetoothDevice;)I", "", ApiSince=29)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.ProfileState GetConnectionState(Android.Bluetooth.BluetoothDevice device);
[<Android.Runtime.Register("getConnectionState", "(Landroid/bluetooth/BluetoothDevice;)I", "", ApiSince=29)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
abstract member GetConnectionState : Android.Bluetooth.BluetoothDevice -> Android.Bluetooth.ProfileState
override this.GetConnectionState : Android.Bluetooth.BluetoothDevice -> Android.Bluetooth.ProfileState

參數

device
BluetoothDevice

透過此設定檔連線的遠端裝置被查詢。

傳回

Value 為下列之一: Disconnected; Connecting; Connected; Disconnecting

實作

屬性

備註

取得針對Build.VERSION_CODES應用程式的設定檔目前連線狀態。若為 S 或更高,則需取得 Manifest.permission.BLUETOOTH_CONNECT 權限,可透過 android.app.Activity.requestPermissions(String[],int)取得。 需要Manifest.permission.BLUETOOTH_CONNECT

Java 文件 android.bluetooth.BluetoothHearingAid.getConnectionState(android.bluetooth.BluetoothDevice)。

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

適用於