【问题标题】:How to turn on bluetooth programatically [duplicate]如何以编程方式打开蓝牙[重复]
【发布时间】:2012-10-19 09:50:13
【问题描述】:

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

您好,我正在开发一个必须以编程方式打开蓝牙的应用程序,请您告诉我如何一步一步地执行此操作,谢谢

【问题讨论】:

  • 你搜索过这个问题吗?

标签: android bluetooth


【解决方案1】:

此代码对我有用。你可以试试这个

  BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();    
        if (!mBluetoothAdapter.isEnabled()) {
           //Play with bluetooth
        }else{ 
            mBluetoothAdapter.disable(); 
        } 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-12
    • 1970-01-01
    • 1970-01-01
    • 2012-12-04
    • 2010-12-17
    • 1970-01-01
    • 2015-03-14
    • 2012-03-01
    相关资源
    最近更新 更多