小编use*_*295的帖子

如何在android中以编程方式启用/禁用蓝牙

大家好,

我想通过程序启用/禁用蓝牙..我有以下代码.

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中做同样的事情.

android bluetooth

101
推荐指数
5
解决办法
16万
查看次数

标签 统计

android ×1

bluetooth ×1