diff --git a/bin/EhViewer.apk b/bin/EhViewer.apk index 8b430f852..65e6c812b 100644 Binary files a/bin/EhViewer.apk and b/bin/EhViewer.apk differ diff --git a/bin/classes.dex b/bin/classes.dex index 6f5bfbd31..6e255922b 100644 Binary files a/bin/classes.dex and b/bin/classes.dex differ diff --git a/bin/resources.ap_ b/bin/resources.ap_ index de0835203..e9959c4f1 100644 Binary files a/bin/resources.ap_ and b/bin/resources.ap_ differ diff --git a/res/raw/change_log b/res/raw/change_log index 406808b13..6b4710b9d 100644 --- a/res/raw/change_log +++ b/res/raw/change_log @@ -1,6 +1,7 @@ Version 0.4.2 (2014-04-04) * 添加内置存储空间或 Sd Card 检测 * 修正由于 gif 格式图片导致的崩溃 +* 修正由文件夹名而可能产生的错误 * 优化网络连接 Version 0.4.1 (2014-04-02) diff --git a/src/com/hippo/ehviewer/UpdateHelper.java b/src/com/hippo/ehviewer/UpdateHelper.java index bca756755..18f6b86a7 100644 --- a/src/com/hippo/ehviewer/UpdateHelper.java +++ b/src/com/hippo/ehviewer/UpdateHelper.java @@ -29,6 +29,9 @@ import com.hippo.ehviewer.util.ThreadPool.JobContext; import com.hippo.ehviewer.view.AlertButton; import com.hippo.ehviewer.widget.DialogBuilder; + +// TODO return onFailure when downloading update or check update + public class UpdateHelper { @SuppressWarnings("unused") private static final String TAG = "UpdateHelper"; @@ -40,6 +43,8 @@ public class UpdateHelper { private static final int GOOGLE = 0; private static final int QINIU = 1; + private static boolean isWorking = false; + private Activity mActivity; private String updateFileName; private OnCheckUpdateListener mListener; @@ -70,6 +75,14 @@ public class UpdateHelper { } public void checkUpdate() { + if (isWorking) { + if (mListener != null) + mListener.onFailure("正在检查更新"); // TODO + return; + } else { + isWorking = true; + } + final AppContext appContext = (AppContext)(mActivity.getApplicationContext()); final HttpHelper hp = new HttpHelper(mActivity.getApplicationContext()); ThreadPool threadPool = appContext.getNetworkThreadPool(); @@ -103,6 +116,8 @@ public class UpdateHelper { }); } + // TODO move dialog into listener + // TODO @SuppressLint("HandlerLeak") private Handler mHandler = new Handler() { @@ -178,6 +193,8 @@ public class UpdateHelper { if (listener != null) listener.onFailure(checkUpdatePackage.hp.getEMsg()); } + + isWorking = false; } };