-
-
Save KaustubhPatange/3dcd34df3f5f26fe884ab2166a6c815b to your computer and use it in GitHub Desktop.
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
onBackInvokedDispatcher.registerOnBackInvokedCallback(1000, object: OnBackInvokedCallback { | |
override fun onBackInvoked() { | |
// perform any action | |
... | |
// finally call the remaining callbacks or just `onBackPressed()` both are same. | |
// if no callback is registered it will fallback to app.Activity -> onBackPressed() | |
onBackPressedDispatcher.onBackPressed() | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment