Commit a8cb22bc authored by wanglei's avatar wanglei

...

parent 77ab198d
......@@ -60,6 +60,7 @@
<activity
android:name=".ui.main.MainActivity"
android:exported="false"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
......
......@@ -112,7 +112,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
//需要设置启动模式,避免AndroidManifest.xml设置singleTop启动模式导致重复启动不生效
//这种方式如果设置了singleTop或者singleTask的,再次回到该activity无法改变于语言,因为还在堆栈里没有重新创建
needRecreate()
if (false) {
if (needRecreate()) {
LogEx.logDebug(TAG, "changeLanguage recreate")
recreate()
} else {
......
......@@ -3,6 +3,7 @@ package com.base.locationsharewhite.ui.main
import android.app.Dialog
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.view.LayoutInflater
import androidx.activity.addCallback
import androidx.core.view.updatePadding
......@@ -50,17 +51,18 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnMapReadyCallback {
private var actionId: Int? = null
override fun initView() {
LogEx.logDebug(TAG, "initView")
BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
val recreated = changeLanguage(this)
val recreated = changeLanguage(this, intent.extras ?: Bundle())
if (recreated) return
mainPresenter = MainPresenter(this)
actionId = intent.extras?.getInt("actionId")
// LogEx.logDebug(TAG, "initView actionId=$actionId", true)
val where = intent.extras?.getString("where")
LogEx.logDebug(TAG, "initView actionId=$actionId where=$where", true)
//
// val flag1 = checkLocationPermission()
// val flag2 = checkBackgroundLocationPermission()
......
......@@ -162,6 +162,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(), SplashView {
else -> {
startActivity(Intent(this, MainActivity::class.java).apply {
putExtra("actionId", actionId)
putExtra("where", "actionId else")
})
}
......
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