How to solve the BluetoothGatt : android.os.DeadObjectException error happened in Android?

前端 未结 4 2012
北恋
北恋 2021-02-13 18:07

I following the page Bluetooth Low Energy for developing in Android 4.3 for Bluetooth Low Energy .

I already can turn on the Bluetooth

4条回答
  •  感情败类
    2021-02-13 18:39

    This problem is very tricky to solve but seems to have to do with some sort of race condition in the android bluetooth stack. Doug's answer of catching Exception e and then checking if its a dead object did not work when I tried. I did notice that when I call

    bluetoothGatt.connect()
    

    a return value of false can indicate a dead object exception.

提交回复
热议问题