Closed sevar83 closed 6 years ago
MviFragments Lifecycle will be changed to onStart()
and onStop()
in next version. See #262
However, it sounds pretty strange that getActivity() is null. That should not be the case since onAttach()
is called before onCreateView()
Yes, 3.0.5-SNAPSHOT uses onStart() - onStop() but has an error with fragmente on the backstack. Its not reay for production yet.
Svetlozar Kostadinov notifications@github.com schrieb am So., 16. Juli 2017, 19:31:
Maybe I don't remember correctly. Probably I've encountered not a null getActivity() but a non-initialized instance. In the past I thought that onCreateView() is called after the activity is created. Is the fragment lifecycle change already implemented to try it out in the SNAPSHOT?
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/sockeqwe/mosby/issues/264#issuecomment-315624041, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjnrkcoZKuk4ogdOjc29D_29beoXlOXks5sOkkIgaJpZM4OZCjk .
Hi, I'm using Mosby 3.0.3 with MVI. Looking at the sample's SearchFragment
The problem is that
getActivity()
is not guaranteed to be non-null in all cases. I had some cases in the past when getActivity() was giving null inonCreateView()
oronViewCreated()
so I started to useonActivityCreated()
to be 100% sure I've got a valid Activity instance. What ifMviFragmentDelegateImpl
attachment code is just moved toonActivityCreated()
. Otherwise a render() call takes place even beforeFragment.onActivityCreated()
. Does not make sense. It's too early.