开启
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
关闭
mBTAdapter = BluetoothAdapter.getDefaultAdapter(); mBTAdapter.disable();
获取已经配对的设备
mPairedDevices = mBTAdapter.getBondedDevices(); for (BluetoothDevice device : mPairedDevices) device.getName() + "\n" + device.getAddress();