From b515e9eea232030b63a5c42dc80c0de456c4cec4 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 8 Sep 2022 13:49:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/utils/VersionUtil.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/utils/VersionUtil.java b/common/src/main/java/com/yunbao/common/utils/VersionUtil.java index 17908dfab..0b5170839 100644 --- a/common/src/main/java/com/yunbao/common/utils/VersionUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/VersionUtil.java @@ -6,6 +6,7 @@ import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.net.Uri; +import android.os.Handler; import android.text.TextUtils; import com.yunbao.common.CommonAppConfig; @@ -108,18 +109,23 @@ public class VersionUtil { UpdateConfig updateConfig = new UpdateConfig(); updateConfig.setShowNotification(true); updateConfig.setAlwaysShowDownLoadDialog(true); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + //UI + UiConfig uiConfig = new UiConfig(); + uiConfig.setUiType(UiType.PLENTIFUL); + UpdateAppUtils + .getInstance() + .uiConfig(uiConfig) + .apkUrl(downloadUrl) + .updateConfig(updateConfig) + .updateTitle("新版本更新") + .updateContent(configBean.getUpdateDes()) + .update(); + } + },2000); - //UI - UiConfig uiConfig = new UiConfig(); - uiConfig.setUiType(UiType.PLENTIFUL); - UpdateAppUtils - .getInstance() - .uiConfig(uiConfig) - .apkUrl(downloadUrl) - .updateConfig(updateConfig) - .updateTitle("新版本更新") - .updateContent(configBean.getUpdateDes()) - .update(); } catch (Exception e) { ToastUtil.show(R.string.version_download_url_error);