How can I return a value after a callback in kotlin, I tried using Thread.sleep but it doesn\'t work
fun searchColorFromAPI(): Colors {
val service: Retro
You can use live data ,that gets updated once the callback receives ,the same live data is observed by the caller fragment/activity
You can use coroutines to return a value from function which has asyn calls in it.
You can use interface callbacks to activity/ fragment to trigger the updates received from retrofit calls.