Unregister USB permission broadcast receiver on activity destroy

This commit is contained in:
Davide Depau 2018-08-17 21:49:16 +02:00
parent 70eb530599
commit 270b97f2bc
Signed by: depau
GPG key ID: C7D999B6A55EFE86

View file

@ -62,6 +62,12 @@ class MainActivity : WizardActivity() {
registerReceiver(mUsbReceiver, filter) registerReceiver(mUsbReceiver, filter)
} }
override fun onDestroy() {
super.onDestroy()
unregisterReceiver(mUsbReceiver)
}
override fun goToNewFragment(fragment: WizardFragment) { override fun goToNewFragment(fragment: WizardFragment) {
StateKeeper.currentFragment?.onFragmentRemoving(this) StateKeeper.currentFragment?.onFragmentRemoving(this)