Merge pull request #216 from Aga-C/going-back-from-thread

Changed back button behavior in thread (#187)
This commit is contained in:
Tibor Kaputa 2021-10-20 09:46:20 +02:00 committed by GitHub
commit feaddf8558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -161,6 +161,7 @@ class ThreadActivity : SimpleActivity() {
R.id.dial_number -> dialNumber()
R.id.manage_people -> managePeople()
R.id.mark_as_unread -> markAsUnread()
android.R.id.home -> onHomePressed()
else -> return super.onOptionsItemSelected(item)
}
return true
@ -173,6 +174,12 @@ class ThreadActivity : SimpleActivity() {
}
}
private fun onHomePressed() {
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}
private fun setupCachedMessages(callback: () -> Unit) {
ensureBackgroundThread {
messages = try {