Commit a8cb22bc authored by wanglei's avatar wanglei

...

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