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

Commit

Permalink
SplashActivity 适配 Android 12 onBackPressed 行为变更
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Jan 17, 2022
1 parent f0e3540 commit c0cce97
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.goooler.demoapp.login.ui

import android.os.Build
import android.os.Bundle
import io.goooler.demoapp.base.core.BaseActivity
import io.goooler.demoapp.common.router.RouterManager
Expand All @@ -12,4 +13,11 @@ class SplashActivity : BaseActivity() {
overridePendingTransition(0, 0)
finish()
}

override fun onBackPressed() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
finish()
else
super.onBackPressed()
}
}

0 comments on commit c0cce97

Please sign in to comment.