ViewPager, getChildFragmentManager () and getFragmentManager ()

I am developing an Android application with TabHost and FragmentActivity on each tab.

In my first tab, I initialize the fragment with the ViewPager indicator and the button, this button opens a dialog with another ViewPager indicator, but my problem is the ViewPager in the root activity of the fragment, faced with the ViewPager dialog.

In the root activity, I call getChildFragmentManager() ... and in order, but in the ViewPager dialog, I call getChildFragmentManager again, but it doesn’t work ...

What am I doing wrong?

+7
android android-fragments android-dialogfragment android-nested-fragment
source share
1 answer

I think the dialog is fragment independent, so try getFragmentManager (), or if you use the support library, use getSuportingFragmentManager ()

+1
source share

All Articles