When using the up arrow, navigate back to the main messages screen

- Ensures only 1 main activity can be launched
This commit is contained in:
Adam Brown 2023-01-07 15:24:36 +00:00
parent 449f1bf4c2
commit 3375ecdb12
2 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application> <application>
<activity android:name="app.dapk.st.home.MainActivity"/> <activity android:name="app.dapk.st.home.MainActivity" android:launchMode="singleInstance"/>
</application> </application>
</manifest> </manifest>

View File

@ -6,6 +6,7 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Parcel import android.os.Parcel
import android.os.Parcelable import android.os.Parcelable
import androidx.core.app.NavUtils
import app.dapk.st.core.AndroidUri import app.dapk.st.core.AndroidUri
import app.dapk.st.core.MimeType import app.dapk.st.core.MimeType
import app.dapk.st.matrix.common.RoomId import app.dapk.st.matrix.common.RoomId
@ -33,7 +34,8 @@ interface Navigator {
} }
fun upToHome() { fun upToHome() {
activity.navigateUpTo(intentFactory.home(activity)) activity.finish()
activity.startActivity(intentFactory.home(activity))
} }
fun toMessenger(roomId: RoomId, attachments: List<MessageAttachment>) { fun toMessenger(roomId: RoomId, attachments: List<MessageAttachment>) {