【问题标题】:Auto enable bluetooth on android phone [duplicate]在Android手机上自动启用蓝牙[重复]
【发布时间】:2011-07-06 14:01:41
【问题描述】:

可能重复:
How to enable/disable bluetooth programmatically in android

我正在尝试编写一个应用程序,该应用程序将打开蓝牙以扫描设备并连接到特定设备(如果它在范围内)。 我的问题是如果蓝牙关闭了如何打开它? 如果我使用:

if (!mBluetoothAdapter.isEnabled()) {
    Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
    startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}

用户是否要打开蓝牙仍有疑问。 我可以在没有用户参与的情况下以编程方式打开吗?

【问题讨论】:

标签: android bluetooth


【解决方案1】:

在没有用户操作的情况下,无法打开某些手机功能,例如 BT、GPS、WiFi。出于安全考虑,它是 1.6(?) 中引入的 android 功能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多