Domanda

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?

È stato utile?

Soluzione

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....:)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top