Eu tenho este erro 'Type mismatch' neste código ´${body.toString()}´:
fun fetchJson(){
val url = "http://localhost:8080/matematica3/naoAutomatica/get"
val request = Request.Builder().url(url).build()
val client = OkHttpClient()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call?, e: IOException?) {
println("${e?.message}")
}
override fun onResponse(call: Call?, response: Response?) {
val body = response?.body()?.string()
println(body)
editTextRespostaAviario?.text = "${body.toString()}"
}
})
}
Como posso resolver?
editTextRespostaAviario?.text = body