Commit df2e7b9e authored by wanglei's avatar wanglei Committed by songjianyu

[修复]恢复对热启动走启动页的处理

parent 36e9bd12
...@@ -3,6 +3,7 @@ package com.base.appzxhy ...@@ -3,6 +3,7 @@ package com.base.appzxhy
import android.app.Activity import android.app.Activity
import android.app.Application import android.app.Application
import android.content.Context import android.content.Context
import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.util.Log import android.util.Log
...@@ -203,13 +204,13 @@ class MyApplication : Application() { ...@@ -203,13 +204,13 @@ class MyApplication : Application() {
LogEx.logDebug(TAG, "flag=$flag" + " activity:" + activity.localClassName) LogEx.logDebug(TAG, "flag=$flag" + " activity:" + activity.localClassName)
if (flag) { if (flag) {
// topActivity?.startActivity( topActivity?.startActivity(
// Intent( Intent(
// topActivity, SplashActivity::class.java topActivity, SplashActivity::class.java
// ).apply { ).apply {
// putExtra("isHotLaunch", true) putExtra("isHotLaunch", true)
// putExtra("type", -1) putExtra("type", -1)
// }) })
} }
} }
lastTimeResume = 0 lastTimeResume = 0
......
...@@ -60,7 +60,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding ...@@ -60,7 +60,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
initUMP() initUMP()
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
actionId = intent?.extras?.getString("actionId") ?: "" handleIntentExtras()
} }
override fun onResumeOneShoot() { override fun onResumeOneShoot() {
...@@ -168,6 +168,10 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding ...@@ -168,6 +168,10 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding
goToAc(GuideCleanActivity::class.java) goToAc(GuideCleanActivity::class.java)
finish() finish()
} }
isHotLaunch->{
goToAc(MainActivity::class.java)
finish()
}
actionId.isNotEmpty() -> { actionId.isNotEmpty() -> {
actionIdJump() actionIdJump()
...@@ -212,10 +216,18 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding ...@@ -212,10 +216,18 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding
} }
} }
var actionId = ""
override fun onNewIntent(intent: Intent?) { override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
handleIntentExtras()
}
var isHotLaunch: Boolean = false
var actionId = ""
fun handleIntentExtras() {
super.onNewIntent(intent) super.onNewIntent(intent)
actionId = intent?.extras?.getString("actionId") ?: "" actionId = intent?.extras?.getString("actionId") ?: ""
isHotLaunch = intent?.extras?.getBoolean("isHotLaunch") == true
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment