From 922bbfe406e79018bb2dd4fc03b7271bcc01c2bc Mon Sep 17 00:00:00 2001 From: hukang <252664817@qq.com> Date: Tue, 16 Mar 2021 09:22:08 +0800 Subject: [PATCH] fix some bugs for app into app store --- .../himindspore/ui/guide/SplashActivity.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/guide/SplashActivity.java b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/guide/SplashActivity.java index 924fc8db644..f48e489b87e 100644 --- a/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/guide/SplashActivity.java +++ b/model_zoo/official/lite/MindSpore_inhand/app/src/main/java/com/mindspore/himindspore/ui/guide/SplashActivity.java @@ -174,16 +174,20 @@ public class SplashActivity extends BaseActivity implements EasyPermissions.Perm private void check() { isCheckPrivacy = prefs.getBoolean(Preferences.KEY_PRIVACY, false); - if (!isCheckPrivacy) { - showPrivacy(); - } else { + if (isCheckPrivacy) { startPermissionsTask(); } } - /** - * 显示用户协议和隐私政策 - */ + @Override + public void onWindowFocusChanged(boolean hasFocus) { + super.onWindowFocusChanged(hasFocus); + isCheckPrivacy = prefs.getBoolean(Preferences.KEY_PRIVACY, false); + if (hasFocus && !isCheckPrivacy){ + showPrivacy(); + } + } + private void showPrivacy() { mContentView = LayoutInflater.from(SplashActivity.this).inflate(R.layout.popup_user, null, false);