Programmatically connect to paired Bluetooth device

前端 未结 4 572
眼角桃花
眼角桃花 2020-11-27 11:14

Is there a way, using the Android SDK, to programmatically connect to an already-paired Bluetooth device?

In other words: I can go into Settings -> Wireless & ne

4条回答
  •  孤城傲影
    2020-11-27 11:35

    the best way I found to solve my problem was finding out that I can create a button that brings up the Bluetooth Settings screen. I didn't realize you could do this, or I would have from the beginning.

    startActivity(new Intent(Settings.ACTION_BLUETOOTH_SETTINGS));
    

提交回复
热议问题