Android - How to enable Bluetooth to be always on?

后端 未结 6 2289
长情又很酷
长情又很酷 2021-02-07 15:58

Two question on Bluetooth development on Android:

  1. Is there a way to enable Bluetooth to be always on (I might have a long device discovery phase in my applicati

6条回答
  •  不要未来只要你来
    2021-02-07 16:35

    On 2.3.6 I can keep the device always visible by putting the delay 0:

    Intent di = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
    di.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 0);
    

提交回复
热议问题