Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit c0cce97

Browse files
committed
SplashActivity 适配 Android 12 onBackPressed 行为变更
1 parent f0e3540 commit c0cce97

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

login/src/main/kotlin/io/goooler/demoapp/login/ui/SplashActivity.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.goooler.demoapp.login.ui
22

3+
import android.os.Build
34
import android.os.Bundle
45
import io.goooler.demoapp.base.core.BaseActivity
56
import io.goooler.demoapp.common.router.RouterManager
@@ -12,4 +13,11 @@ class SplashActivity : BaseActivity() {
1213
overridePendingTransition(0, 0)
1314
finish()
1415
}
16+
17+
override fun onBackPressed() {
18+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
19+
finish()
20+
else
21+
super.onBackPressed()
22+
}
1523
}

0 commit comments

Comments
 (0)