From 4169a79eaf43165211bdb89afae6b88c9e170bc4 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Tue, 5 Mar 2024 21:02:53 +0530 Subject: [PATCH] =?UTF-8?q?Fixed:=20PlayStore=20reported=20an=20error=20fo?= =?UTF-8?q?r=20Encyclop=C3=A9die=20m=C3=A9dicale=20WikiMed=20app.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed where restarting app was not working on Android 11 and above. --- .../java/org/kiwix/kiwixmobile/core/error/ErrorActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/error/ErrorActivity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/error/ErrorActivity.kt index ef888d9e9..e6a752c89 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/error/ErrorActivity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/error/ErrorActivity.kt @@ -214,7 +214,10 @@ open class ErrorActivity : BaseActivity() { }.toString() open fun restartApp() { - startActivity(packageManager.getLaunchIntentForPackage(packageName)) + val restartAppIntent = packageManager.getLaunchIntentForPackage(packageName)?.apply { + addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK) + } + startActivity(restartAppIntent) finish() killCurrentProcess() }