|
|
@@ -14,6 +14,7 @@ import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.common.data.JSONUtil;
|
|
|
import com.core.net.ProgressDownloader;
|
|
|
import com.core.net.ProgressResponseBody;
|
|
|
import com.core.net.http.ViewUtil;
|
|
|
@@ -115,10 +116,20 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
|
|
|
break;
|
|
|
case com.core.app.Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
result = msg.getData().getString("response");
|
|
|
- if (JSON.parseObject(result) != null && TextUtils.isEmpty(JSON.parseObject(result).getString("exceptionInfo"))) {
|
|
|
+ String exception = "";
|
|
|
+ if (JSONUtil.validate(result)) {
|
|
|
+ if (JSON.parse(result) instanceof JSONObject) {
|
|
|
+ exception = JSON.parseObject(result).getString("exceptionInfo");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (TextUtils.isEmpty(exception)) {
|
|
|
analysisPdfPath(result);
|
|
|
} else {
|
|
|
- ToastMessage(msg.getData().getString("result"));
|
|
|
+ mPauseTextView.setVisibility(View.GONE);
|
|
|
+ mErrorLinearLayout.setVisibility(View.VISIBLE);
|
|
|
+ mStateTextView.setText(R.string.data_exception);
|
|
|
+ mDownloadProgressBar.setProgress(0);
|
|
|
+ mRemainTextView.setText(100 + "");
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
@@ -341,6 +352,7 @@ public class PDFDownloadActivity extends BaseActivity implements View.OnClickLis
|
|
|
|
|
|
@Override
|
|
|
public void onError(Throwable t) {
|
|
|
+ Log.e("pdfloaderror", t.getMessage() == null ? "" : t.getMessage());
|
|
|
mPauseTextView.setVisibility(View.GONE);
|
|
|
mErrorLinearLayout.setVisibility(View.VISIBLE);
|
|
|
mStateTextView.setText("报表文件加载失败!");
|