问题
I have a ViewPager contains three fragment, and I want to put 3 new fragments into the third fragment.Is that possible?
[ViewPager]
[Fragment 1]
[Fragment 2]
[Fragment 3]
[Fragment 3-1]
[Fragment 3-2]
[Fragment 3-3]
[ViewPager]
EDIT: I can't getChildFragmentManager() but only getFragmentManager(), I'm using android.support.v4.app:
FragmentManager fm = getFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.add(R.layout.tools_frame5, new Plugins());
ft.commit();
EDIT: what about Putting 3 Activities in the third Fragment, Is that possible?
回答1:
Yes, Nested fragment is possible.
You have to use getChildFragmentManager() instead of getFragmentManager() while you are working with nested fragments. For more details look into this link.
Hope this will help you....:)
来源:https://stackoverflow.com/questions/17269187/is-nested-fragment-possible