Unregister USB permission broadcast receiver on activity destroy

This commit is contained in:
Davide Depau 2018-08-17 21:49:16 +02:00
parent 72b68c844d
commit 4b67f41c74

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)