Skip to content

Commit

Permalink
smoother back navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Okuro3499 committed Sep 25, 2024
1 parent 39db726 commit 367d31f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ abstract class BaseActivity : AppCompatActivity() {
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item.itemId == R.id.home) finish()
return super.onOptionsItemSelected(item)
return if (item.itemId == android.R.id.home) {
finish()
true
} else {
super.onOptionsItemSelected(item)
}
}
}

0 comments on commit 367d31f

Please sign in to comment.