override fun onBackPressed() {
        super.onBackPressed()
        finishAffinity()
      }

      Kotlin language logo
      finishActivity

      Kotlin recipes

      The override method onBackPressed() will be called when the user presses the back button. First, the super method will be called. This will cause any current activity to finish. Then, the onBackPressed() method will be called. This method will do anything that needs to be done when the user presses the back button.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.