From 3533359fae83ee609e64eb43d2b72e669ab55083 Mon Sep 17 00:00:00 2001 From: inorichi Date: Sat, 13 Apr 2019 13:09:01 +0200 Subject: [PATCH] Use single task activity --- app/src/main/AndroidManifest.xml | 2 +- .../main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7f47468345..feddf20960 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -23,7 +23,7 @@ android:theme="@style/Theme.Tachiyomi"> + android:launchMode="singleTask"> diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index a1a5c93b65..00acfa494a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -167,7 +167,9 @@ class MainActivity : BaseActivity() { //Get the search query provided in extras, and if not null, perform a global search with it. val query = intent.getStringExtra(SearchManager.QUERY) if (query != null && !query.isEmpty()) { - setSelectedDrawerItem(R.id.nav_drawer_catalogues) + if (router.backstackSize > 1) { + router.popToRoot() + } router.pushController(CatalogueSearchController(query).withFadeTransaction()) } } @@ -175,7 +177,9 @@ class MainActivity : BaseActivity() { val query = intent.getStringExtra(INTENT_SEARCH_QUERY) val filter = intent.getStringExtra(INTENT_SEARCH_FILTER) if (query != null && !query.isEmpty()) { - setSelectedDrawerItem(R.id.nav_drawer_catalogues) + if (router.backstackSize > 1) { + router.popToRoot() + } router.pushController(CatalogueSearchController(query, filter).withFadeTransaction()) } }