gergo
02/10/2020, 4:22 PMsuspend fun
annotated with @Throws(IOException::class)
, then the IDE will signal an “Inapropiate blocking method call”, even if the called method runs on the IO dispatcher. Example:
suspend fun testCall(uri: Uri) {
val image = encodeImageToBase64(uri)
}
@Throws(IOException::class)
private suspend fun encodeImageToBase64(imageUri: Uri): String = withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
// Do something
""
}
(Android Studio 3.6-rc02, kotlin version: 1.3.50/1.3.61)
I am not sure why this warning is shown in such case? Could this be a lint issue or am I missing something?Brandon Trautmann
02/10/2020, 4:37 PMKroppeb
02/10/2020, 11:09 PM