Changed back button behavior in thread (#187)

This commit is contained in:
Agnieszka C 2021-09-26 23:33:39 +02:00
parent 1a4ceadbee
commit cce617b12f
1 changed files with 8 additions and 0 deletions

View File

@ -159,6 +159,7 @@ class ThreadActivity : SimpleActivity() {
R.id.delete -> askConfirmDelete() R.id.delete -> askConfirmDelete()
R.id.manage_people -> managePeople() R.id.manage_people -> managePeople()
R.id.mark_as_unread -> markAsUnread() R.id.mark_as_unread -> markAsUnread()
android.R.id.home -> onBackPressed()
else -> return super.onOptionsItemSelected(item) else -> return super.onOptionsItemSelected(item)
} }
return true return true
@ -171,6 +172,13 @@ class ThreadActivity : SimpleActivity() {
} }
} }
override fun onBackPressed() {
super.onBackPressed()
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}
private fun setupCachedMessages(callback: () -> Unit) { private fun setupCachedMessages(callback: () -> Unit) {
ensureBackgroundThread { ensureBackgroundThread {
messages = try { messages = try {