Overview model: RequireActivity instead of fragment

This commit is contained in:
jbr7rr 2023-07-13 08:30:28 +02:00
parent f24c872415
commit d93cc51819

View file

@ -34,7 +34,7 @@ class MedtrumOverviewFragment : MedtrumBaseFragment<FragmentMedtrumOverviewBindi
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
binding.apply { binding.apply {
viewmodel = ViewModelProvider(this@MedtrumOverviewFragment, viewModelFactory).get(MedtrumOverviewViewModel::class.java) viewmodel = ViewModelProvider(requireActivity(), viewModelFactory)[MedtrumOverviewViewModel::class.java]
viewmodel?.apply { viewmodel?.apply {
eventHandler.observe(viewLifecycleOwner) { evt -> eventHandler.observe(viewLifecycleOwner) { evt ->
when (evt.peekContent()) { when (evt.peekContent()) {