Use viewTreeLifecycleOwner

This commit is contained in:
Mygod
2020-06-01 16:21:49 -04:00
parent fb5283e61a
commit 379c3b226f
7 changed files with 12 additions and 11 deletions

View File

@@ -140,7 +140,7 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
private val tethering = BluetoothTethering(parent.requireContext()) { onTetheringStarted() }
init {
parent.lifecycle.addObserver(this)
parent.viewLifecycleOwner.lifecycle.addObserver(this)
}
override fun onDestroy(owner: LifecycleOwner) = tethering.close()