diff --git a/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIFragment.kt b/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIFragment.kt index e7efddaf2..ae71f3852 100644 --- a/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIFragment.kt @@ -35,7 +35,7 @@ abstract class BaseUIFragment : ): View? { binding = DataBindingUtil.inflate(inflater, layoutRes, container, false).also { it.setVariable(BR.viewModel, viewModel) - it.lifecycleOwner = this + it.lifecycleOwner = viewLifecycleOwner } return binding.root } diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt index 202fd0a37..af57c2dec 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/theme/ThemeFragment.kt @@ -34,7 +34,7 @@ class ThemeFragment : BaseUIFragment() inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? - ): View? { + ): View { super.onCreateView(inflater, container, savedInstanceState) for ((a, b) in Theme.values().paired()) { @@ -48,7 +48,7 @@ class ThemeFragment : BaseUIFragment() ItemThemeBindingImpl.inflate(LayoutInflater.from(themed), view, true).also { it.setVariable(BR.viewModel, viewModel) it.setVariable(BR.theme, theme) - it.lifecycleOwner = this + it.lifecycleOwner = viewLifecycleOwner } }