大家好,
我想通过程序启用/禁用蓝牙..我有以下代码.
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (!mBluetoothAdapter.isEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
Run Code Online (Sandbox Code Playgroud)
但是这种代码在SDK 1.5中不起作用.我怎么能在SDK 1.5中做同样的事情.