Skip to content

Instantly share code, notes, and snippets.

@huuphuoc1396
Last active October 19, 2020 07:45
Show Gist options
  • Save huuphuoc1396/5030801cc23e05abae1e9afc4d7222a9 to your computer and use it in GitHub Desktop.
Save huuphuoc1396/5030801cc23e05abae1e9afc4d7222a9 to your computer and use it in GitHub Desktop.
Remove all callbacks when this activity is destroyed
override fun onDestroy() {
// Remove all callbacks when this activity is destroyed
displayManagerHelper?.unregisterCoverDisplayEnabledCallback(applicationContext.packageName)
displayManagerHelper?.unregisterSmartCoverCallback(smartCoverCallback)
super.onDestroy()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment