call.enqueue(new Callback<User>() {
@Override
public void onResponse(Call<User> call, Response<User> response) {
// todo deal with returned data (user)
}
@Override
public void onFailure(Call<User> call, Throwable t) {
// todo deal with the failed network request
}
});
我试过以下方法:
call.enqueue(
(Call<User> call, Response<User> response) -> {
// todo deal with returned data (user)
},
(Call<User> call, Throwable t) -> {
// todo deal with the failed network request
});
在接口中找到多个非重写抽象方法
改造2.回拨
用lambda表达式来表示这一点的正确方法是什么?将代码转换为lambda表达式的正确过程是什么?