【发布时间】:2022-01-01 21:16:15
【问题描述】:
是否有以编程方式检查 Android 设备上蓝牙是否处于活动状态?
要知道位置是否启用,如下所示:
if (!Input.location.isEnabledByUser)
{
//Location not active!
return;
}
【问题讨论】:
标签: c# android unity3d bluetooth bluetooth-lowenergy
是否有以编程方式检查 Android 设备上蓝牙是否处于活动状态?
要知道位置是否启用,如下所示:
if (!Input.location.isEnabledByUser)
{
//Location not active!
return;
}
【问题讨论】:
标签: c# android unity3d bluetooth bluetooth-lowenergy
我猜你可以只检查适配器状态:
public void EnableIfNeeded(BluetoothAdapter adapter)
{
if (!adapter.IsEnabled)
{
adapter.Enable();
}
}
【讨论】: