Convert callback hell to deferred object
问题 Background : So, I have a pretty big project with a lot of API functions. I'm thinking of completely moving to coroutines, but as they are implemented as Callback and not Deferred , I can not use them efficiently. For instance: I would like to do apiCallOne() , apiCallTwo() and apiCallThree() async and call .await() to wait till the last request is completed before changing UI. Now the project is structured like this: At the very bottom (or top) is ApiService.java : interface ApiService {