Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Dec 8, 2023
1 parent e904c8a commit 25aec01
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/main/java/io/legado/app/help/IntentHelp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.legado.app.help
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import io.legado.app.R
import io.legado.app.utils.toastOnUi
import splitties.init.appCtx
Expand All @@ -16,7 +17,9 @@ object IntentHelp {

fun getBrowserIntent(uri: Uri): Intent {
val intent = Intent(Intent.ACTION_VIEW)
intent.`package` = appCtx.packageName
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
intent.`package` = appCtx.packageName
}
intent.data = uri
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
if (intent.resolveActivity(appCtx.packageManager) == null) {
Expand Down

0 comments on commit 25aec01

Please sign in to comment.