Closed jjhesk closed 8 years ago
Hey jjhesk,
Thanks a lot for the feedback and use of my library. I'm still very early stages (hence not even v1 yet) but I'm happy to try and help with anything you are encountering to improve the Manager and your experience with it.
I'm not quite sure I fully understand the set up that you have. It looks like you are adding this fragment with a ViewPager
to a SingleStackFragmentManager
at a previous point in the application?
One point in the code that I noticed that may give an issue is that since you are inside a fragment already, the ViewPager
should be using getChildFragmentManager()
instead of getFragmentManager()
on this line in the getAdapter()
method:
return new FragmentPagerItemAdapter(getFragmentManager(), itemCreator.create());
I ran into this issue previously (I can't remember the exact Exception
) but changing the above line from getFragmentManager()
to getChildFragmentManager()
should clear up a possible issue. Give this a try and let me know if that clears it up. If not can you please post the full stack of the acceptation so that I can look further into what is going on?
Thanks, DMCApps
I dont know how to work with this. I found out that when i start to hide the app as i press the home button. It will crash and show java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name =
and it caused by : navigationfragment.manager.SingleStackNavigationManagerFragment
Updated so that the NavigationManagerFragments are all Serializable.
This should be fixed in 0.0.4.2
Please let me know if it persists after updating
Hey jjhesk,
So this issue seems to have been bigger than I expected. As I was using the Manager, I ran into this "NotSerializableException" on my home button press and any time I presented an activity. I was expecting that it was because my class was not Serializable hence I removed anything that wasn't serializable from my class and it was working.
The issue continues to happen though anytime you have a fragment with a property in it that is not serializable in it. So I have made a fix for this and it can be found as 0.0.5. All the methods for using the Manager remain the same so you should be good to go once you upgrade to 0.0.5!
Thanks for your continued use and pantience.
fixed cheers!
First of all, thank you for the amazing work. Here I got another challenge from the crashes on using
v0.0.4
. I have an example that the childfragment manager inside the fragment is used for supply the works for mutifragment holder such as ViewPager and SmartTabLayout. In this case I got all other things flashing in the page. what can i do to make it work?Noticed that I set
pager.setOffscreenPageLimit(0);
because i need to constraint memory for another activities. In this layout I had to init a viewpager for display usereturn new FragmentPagerItemAdapter(getFragmentManager(), itemCreator.create());
or usingreturn new FragmentPagerItemAdapter(getChildFragmentManager(), itemCreator.create());
this adapter is weakReference to holding all the config for the viewpagerprivate final SparseArrayCompat<WeakReference<Fragment>> holder;
into the SparseArrayCompatthis.holder = new SparseArrayCompat<>(pages.size());
resulted IOexecption:
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name =