Slide 22
Slide 22 text
Hey…I could use Callbacks without assignment
void start() {
service = retrofit.create(ApiService.class);
Call call = service.getDetails();
call.enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) {
service.getFriendDetails(response.body().friendId).enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) {
service.getFriendMessages(response.body().id).enqueue(new Callback>() {
@Override
public void onResponse(Call> call, Response> response) {…}
@Override public void onFailure(Call> call, Throwable t) {…}
});
}
@Override public void onFailure(Call call, Throwable t) {…}
});
}
@Override public void onFailure(Call call, Throwable t) {…}
});
}