Browse Source

修改启动页为singleTask

Pq 2 years ago
parent
commit
4ded5f928c

+ 1 - 0
student/src/main/AndroidManifest.xml

@@ -34,6 +34,7 @@
         <activity
             android:name=".ui.splash.SplashActivity"
             android:exported="true"
+            android:launchMode="singleTask"
             android:theme="@style/SplashTheme">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />

+ 6 - 0
student/src/main/java/com/cooleshow/student/ui/splash/SplashActivity.kt

@@ -1,6 +1,7 @@
 package com.cooleshow.student.ui.splash
 
 import android.animation.Animator
+import android.content.Intent
 import android.net.Uri
 import android.os.Bundle
 import android.text.Spannable
@@ -59,6 +60,11 @@ class SplashActivity : BaseActivity<ActivitySplashLayoutBinding>() {
         })
     }
 
+    override fun onNewIntent(intent: Intent?) {
+        super.onNewIntent(intent)
+        checkPrivacyMode();
+    }
+
     override fun initData() {
         super.initData()
     }

+ 1 - 0
teacher/src/main/AndroidManifest.xml

@@ -47,6 +47,7 @@
         <activity
             android:name=".ui.splash.SplashActivity"
             android:exported="true"
+            android:launchMode="singleTask"
             android:screenOrientation="portrait"
             android:theme="@style/SplashTheme">
             <intent-filter>

+ 6 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/splash/SplashActivity.kt

@@ -1,6 +1,7 @@
 package com.cooleshow.teacher.ui.splash
 
 import android.animation.Animator
+import android.content.Intent
 import android.net.Uri
 import android.text.Spannable
 import android.text.SpannableStringBuilder
@@ -55,6 +56,11 @@ class SplashActivity : BaseActivity<ActivitySplashLayoutBinding>() {
         super.initData()
     }
 
+    override fun onNewIntent(intent: Intent?) {
+        super.onNewIntent(intent)
+        checkPrivacyMode();
+    }
+
     private fun checkPrivacyMode() {
         var privacyMode = UserHelper.getAppPrivacyMode()
         if (privacyMode == 0) {