unable to make connection between 2 device bluetooth android

前端 未结 4 572
甜味超标
甜味超标 2021-01-31 04:02

I have tried to connect two devices by using the Android Bluetooth Chat example on the Android developer site. It\'s only connecting from one of the devices and when I am tryi

4条回答
  •  离开以前
    2021-01-31 04:16

    I have done this,and i think you get connection lost when the device discoverable change. Please do check the device discoverable in both,you can enable it by code.

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

提交回复
热议问题