Android - How to enable Bluetooth to be always on?

后端 未结 6 1136
太阳男子
太阳男子 2021-02-07 15:40

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:33

    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);
    

提交回复
热议问题