Skip to content

Commit

Permalink
fix back key not working to close the app
Browse files Browse the repository at this point in the history
  • Loading branch information
sal0max committed Feb 3, 2024
1 parent 81b871d commit f94b6b4
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,11 @@ class MainActivity : BaseActivity() {
'/' -> viewModel.division()
else ->
// delete
if (keyCode == KeyEvent.KEYCODE_DEL)
viewModel.delete()
else
return false
when (keyCode) {
KeyEvent.KEYCODE_DEL -> viewModel.delete()
KeyEvent.KEYCODE_BACK -> super.onBackPressedDispatcher.onBackPressed()
else -> return false
}
}
return true
}
Expand Down

0 comments on commit f94b6b4

Please sign in to comment.