From 1a32d43d1c57ef79ba9ea875646732a06776570d Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Tue, 1 Jun 2021 09:02:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E6=9C=BA?= =?UTF-8?q?=E5=9E=8B=E6=A6=82=E7=8E=87=E6=80=A7=E9=97=AA=E9=80=80=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updatelog.fy | 5 +++++ .../myreader/ui/activity/SplashActivity.java | 19 +++++++------------ app/version_code.properties | 4 ++-- build.gradle | 1 + 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/src/main/assets/updatelog.fy b/app/src/main/assets/updatelog.fy index b99186b..6acce41 100644 --- a/app/src/main/assets/updatelog.fy +++ b/app/src/main/assets/updatelog.fy @@ -1,3 +1,8 @@ +2021.06.01 +风月读书v2.0.2 +更新内容: +1、修复部分机型概率性启动闪退的问题 + 2021.05.29 风月读书v2.0.2 更新内容: diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java index 1a01110..554cee7 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java @@ -57,12 +57,13 @@ public class SplashActivity extends BaseActivity { private SharedPreUtils spu; private int todayAdCount; private int adTimes; + private boolean hasStart = false; private PermissionsChecker mPermissionsChecker; //创建子线程 - private Thread start = new Thread() { - @Override - public void run() { + private Runnable start = () -> { + if (!hasStart && !App.isDestroy(SplashActivity.this)) { + hasStart = true; try { Thread.sleep(WAIT_INTERVAL);//使程序休眠 Intent it = new Intent(SplashActivity.this, MainActivity.class);//启动MainActivity @@ -200,21 +201,15 @@ public class SplashActivity extends BaseActivity { if (BookGroupService.getInstance().curGroupIsPrivate()) { App.runOnUiThread(() -> { MyAlertDialog.showPrivateVerifyDia(SplashActivity.this, needGoTo -> { - if (!start.isAlive()) { - start.start(); - } + (new Thread(start)).start(); }, () -> { SharedPreUtils.getInstance().putString(SplashActivity.this.getString(R.string.curBookGroupId), ""); SharedPreUtils.getInstance().putString(SplashActivity.this.getString(R.string.curBookGroupName), ""); - if (!start.isAlive()) { - start.start(); - } + (new Thread(start)).start(); }); }); } else { - if (!start.isAlive()) { - start.start(); - } + (new Thread(start)).start(); } } } diff --git a/app/version_code.properties b/app/version_code.properties index 4e383d4..e073c3c 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Sat May 29 12:39:33 CST 2021 -VERSION_CODE=202 +#Tue Jun 01 08:59:40 CST 2021 +VERSION_CODE=204 diff --git a/build.gradle b/build.gradle index 71b15fb..40dbb61 100644 --- a/build.gradle +++ b/build.gradle @@ -16,6 +16,7 @@ buildscript { classpath 'com.android.tools.build:gradle:4.1.2' classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }