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

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

parent 36e9bd12
......@@ -3,6 +3,7 @@ package com.base.appzxhy
import android.app.Activity
import android.app.Application
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import android.util.Log
......@@ -203,13 +204,13 @@ class MyApplication : Application() {
LogEx.logDebug(TAG, "flag=$flag" + " activity:" + activity.localClassName)
if (flag) {
// topActivity?.startActivity(
// Intent(
// topActivity, SplashActivity::class.java
// ).apply {
// putExtra("isHotLaunch", true)
// putExtra("type", -1)
// })
topActivity?.startActivity(
Intent(
topActivity, SplashActivity::class.java
).apply {
putExtra("isHotLaunch", true)
putExtra("type", -1)
})
}
}
lastTimeResume = 0
......
......@@ -60,7 +60,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding
override fun onCreate(savedInstanceState: Bundle?) {
initUMP()
super.onCreate(savedInstanceState)
actionId = intent?.extras?.getString("actionId") ?: ""
handleIntentExtras()
}
override fun onResumeOneShoot() {
......@@ -168,6 +168,10 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding
goToAc(GuideCleanActivity::class.java)
finish()
}
isHotLaunch->{
goToAc(MainActivity::class.java)
finish()
}
actionId.isNotEmpty() -> {
actionIdJump()
......@@ -212,10 +216,18 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding
}
}
var actionId = ""
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
handleIntentExtras()
}
var isHotLaunch: Boolean = false
var actionId = ""
fun handleIntentExtras() {
super.onNewIntent(intent)
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