Created
September 17, 2020 11:54
-
-
Save siifii/5dfec4591094357fa6c08ec54e255250 to your computer and use it in GitHub Desktop.
handle fragment onBack pressed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
activity?.onBackPressedDispatcher?.addCallback(this, object : OnBackPressedCallback(true) { | |
override fun handleOnBackPressed() { | |
//YOUR_CODE | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment