-1

重複の可能性:
AndroidでBluetoothをプログラムで有効/無効にする方法

こんにちは、プログラムで Bluetooth をオンにする必要があるアプリケーションを開発しています。

4

1 に答える 1

3

このコードは私にとってはうまくいきます。これを試すことができます

  BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();    
        if (!mBluetoothAdapter.isEnabled()) {
           //Play with bluetooth
        }else{ 
            mBluetoothAdapter.disable(); 
        } 
于 2012-10-19T09:52:18.313 に答える