From 6d9bec3e0bfdc896f22e19af9b6ad8a084442364 Mon Sep 17 00:00:00 2001 From: MCAxiaz Date: Tue, 28 Jan 2020 19:15:15 -0800 Subject: [PATCH] reroute all deep links through DeepLinkActivity to provide more control (#2546) over launch behavior/intent flags --- app/src/main/AndroidManifest.xml | 11 ++++++++--- .../tachiyomi/ui/main/DeepLinkActivity.kt | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/main/DeepLinkActivity.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7ad671ffed..9d22c5b7d3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,12 +28,19 @@ android:theme="@style/Theme.Tachiyomi"> + + + + @@ -44,8 +51,6 @@ - - diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/DeepLinkActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/DeepLinkActivity.kt new file mode 100644 index 0000000000..ae37f883b9 --- /dev/null +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/DeepLinkActivity.kt @@ -0,0 +1,19 @@ +package eu.kanade.tachiyomi.ui.main + +import android.app.Activity +import android.content.Intent +import android.os.Bundle + +class DeepLinkActivity: Activity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + intent.apply { + flags = flags or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK + setClass(applicationContext, MainActivity::class.java) + } + startActivity(intent) + finish() + } +} \ No newline at end of file