|
@@ -6,6 +6,7 @@ import android.util.Log;
|
|
|
|
|
|
|
|
import com.google.gson.JsonParseException;
|
|
import com.google.gson.JsonParseException;
|
|
|
import com.mgtech.base_library.R;
|
|
import com.mgtech.base_library.R;
|
|
|
|
|
+import com.mgtech.base_library.contextUtil.ContextUtils;
|
|
|
import com.mgtech.base_library.http.exception.NoDataExceptionException;
|
|
import com.mgtech.base_library.http.exception.NoDataExceptionException;
|
|
|
import com.mgtech.base_library.http.exception.ServerResponseException;
|
|
import com.mgtech.base_library.http.exception.ServerResponseException;
|
|
|
import com.mgtech.base_library.util.ToastUtils;
|
|
import com.mgtech.base_library.util.ToastUtils;
|
|
@@ -121,23 +122,23 @@ public abstract class BaseObserver<T> implements Observer<T> {
|
|
|
public void onException(ExceptionReason reason) {
|
|
public void onException(ExceptionReason reason) {
|
|
|
switch (reason) {
|
|
switch (reason) {
|
|
|
case CONNECT_ERROR:
|
|
case CONNECT_ERROR:
|
|
|
- ToastUtils.showShort(R.string.connect_error);
|
|
|
|
|
|
|
+ ToastUtils.showShort(ContextUtils.getContext().getString(R.string.connect_error));
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case CONNECT_TIMEOUT:
|
|
case CONNECT_TIMEOUT:
|
|
|
- ToastUtils.showShort(R.string.connect_timeout);
|
|
|
|
|
|
|
+ ToastUtils.showShort(ContextUtils.getContext().getString(R.string.connect_timeout));
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case BAD_NETWORK:
|
|
case BAD_NETWORK:
|
|
|
- ToastUtils.showShort(R.string.bad_network);
|
|
|
|
|
|
|
+ ToastUtils.showShort(ContextUtils.getContext().getString(R.string.bad_network));
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case PARSE_ERROR:
|
|
case PARSE_ERROR:
|
|
|
- ToastUtils.showShort(R.string.parse_error);
|
|
|
|
|
|
|
+ ToastUtils.showShort(ContextUtils.getContext().getString(R.string.parse_error));
|
|
|
break;
|
|
break;
|
|
|
case UNKNOWN_ERROR:
|
|
case UNKNOWN_ERROR:
|
|
|
default:
|
|
default:
|
|
|
- ToastUtils.showShort(R.string.unknown_error);
|
|
|
|
|
|
|
+ ToastUtils.showShort(ContextUtils.getContext().getString(R.string.unknown_error));
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|