<@U2E974ELT> the other day someone said `withConte...
# coroutines
b
@elizarov the other day someone said
withContext(UI) { }
was equivalent to
async(UI) { }.await()
, but I am having serious problems with the latter, was that not the case?
l
@bj0 What "serious issues" do you have with async + await ?
b
the other way around, I'm reading battery level from a BLE characteristic, it works fine with `async(UI)`+`await`, returns ~86%. If I switch to using
withContext(UI)
, the read returns 0x64 (100) and then the application crashes with
E/BluetoothManagerService: btsvc manager.putLogs                                                          java.lang.ArrayIndexOutOfBoundsException: src.length=494 srcPos=0 dst.length=743 dstPos=0 length=508
maybe that was a red herring, might just be an inconsistent BLE crash.... i'm really hating BLE on android
l
Weird. You're getting the issue using BleGattCoroutines? Feel free to reach through DM to provide more details, I can probably help