From 3375ecdb122dc595e8b06ba66434d257d69352e1 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Sat, 7 Jan 2023 15:24:36 +0000 Subject: [PATCH] When using the up arrow, navigate back to the main messages screen - Ensures only 1 main activity can be launched --- features/home/src/main/AndroidManifest.xml | 2 +- .../src/main/kotlin/app/dapk/st/navigator/Navigator.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/features/home/src/main/AndroidManifest.xml b/features/home/src/main/AndroidManifest.xml index 67144a8..f0be1d3 100644 --- a/features/home/src/main/AndroidManifest.xml +++ b/features/home/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/features/navigator/src/main/kotlin/app/dapk/st/navigator/Navigator.kt b/features/navigator/src/main/kotlin/app/dapk/st/navigator/Navigator.kt index e52d34c..ad70891 100644 --- a/features/navigator/src/main/kotlin/app/dapk/st/navigator/Navigator.kt +++ b/features/navigator/src/main/kotlin/app/dapk/st/navigator/Navigator.kt @@ -6,6 +6,7 @@ import android.content.Context import android.content.Intent import android.os.Parcel import android.os.Parcelable +import androidx.core.app.NavUtils import app.dapk.st.core.AndroidUri import app.dapk.st.core.MimeType import app.dapk.st.matrix.common.RoomId @@ -33,7 +34,8 @@ interface Navigator { } fun upToHome() { - activity.navigateUpTo(intentFactory.home(activity)) + activity.finish() + activity.startActivity(intentFactory.home(activity)) } fun toMessenger(roomId: RoomId, attachments: List) {