Response的onFailure参数修改为HttpException

This commit is contained in:
huangzhuanghua
2017-01-11 12:00:20 +08:00
parent 93ec154b7e
commit a8a9e58fe9
42 changed files with 162 additions and 277 deletions

View File

@ -153,18 +153,15 @@ public class UpdateManager {
}
@Override
public void onFailure(Throwable e) {
public void onFailure(HttpException e) {
isChecking = false;
if (loadingDialog != null) {
loadingDialog.dismiss();
}
if (!isCheck) {
if (e instanceof HttpException) {
HttpException exception = (HttpException) e;
if (exception.code() == 304) {
Toast.makeText(context, "您的光环助手已是最新版本", Toast.LENGTH_SHORT).show();
return;
}
if (e != null && e.code() == 304) {
Toast.makeText(context, "您的光环助手已是最新版本", Toast.LENGTH_SHORT).show();
return;
}
Toast.makeText(context, "检查更新失败", Toast.LENGTH_SHORT).show();