当我使用这样的异步方式使用OkHttp库时:
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
e.printStackTrace();
}
@Override
public void onResponse(Call call, Response response) throws IOException {
}
});
Run Code Online (Sandbox Code Playgroud)
在onFailure方法中,我如何获得响应状态代码以区分不同的错误.例如,网络错误或服务器错误?
就像这段代码:
dependencies {
compile ('com.wdullaer:materialdatetimepicker:3.2.2') {
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'design'
}
}
Run Code Online (Sandbox Code Playgroud)
在android应用程序build.gradle文件中,当我想依赖远程库时,如何使用排除组语法来排除多个组?
上面的代码虽然是正确的方法,但是有点复杂,有没有更简单的方法?