From 4fd945287fd761e37de1db73137a48d49a6cceda Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 5 Feb 2021 09:22:26 +0800 Subject: [PATCH] edit ContextExtensions.kt --- app/src/main/java/io/legado/app/utils/ContextExtensions.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt index 3f287764c..490ac0f36 100644 --- a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt @@ -28,7 +28,10 @@ import java.io.File import java.io.FileOutputStream inline fun Context.startActivity(configIntent: Intent.() -> Unit = {}) { - startActivity(Intent(this, A::class.java).apply(configIntent)) + val intent = Intent(this, A::class.java) + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + intent.apply(configIntent) + startActivity(intent) } inline fun Context.startService(configIntent: Intent.() -> Unit = {}) {