Skip to content

Instantly share code, notes, and snippets.

@hamurcuabi
Last active October 29, 2022 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamurcuabi/957606ed1c538c89bd0f162e3c8a9714 to your computer and use it in GitHub Desktop.
Save hamurcuabi/957606ed1c538c89bd0f162e3c8a9714 to your computer and use it in GitHub Desktop.
class HomeFragment : Fragment(),
OnBackPressedDelegation by OnBackPressedDelegationImpl() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
registerOnBackPressedDelegation(activity, this.lifecycle) {
// OnBackPressed fired!!!
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment