INNER CODE UNIT · Kotlin
onBackPressed
Keyspace-cloud/android · app/src/main/kotlin/cloud/keyspace/android/AddCard.kt:594
override fun onBackPressed () {
val alertDialog: AlertDialog = MaterialAlertDialogBuilder(this).create()
alertDialog.setTitle("Confirm exit")
alertDialog.setMessage("Would you like to go back to the Dashboard?")
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "Exit") { dialog, _ ->
crypto.secureStartActivity (
nextActivity = Dashboard(),
nextActivityClassNameAsString = getString(R.string.title_activity_dashboard),
keyring = keyring,
itemId = null
)
super.onBackPressed()
tagIdGrabber.removeCallbacksAndMessages(null)
}
alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, "Cancel") { dialog, _ -> dialog.dismiss() }
alertDialog.show()
}