dinsdag 4 juni 2013

IllegalStateException: Recursive entry to executePendingTransactions

I got the below error when converting an Activity to a Fragment that holds a ViewPager.

06-01 10:14:49.698: E/AndroidRuntime(8102): FATAL EXCEPTION: main
06-01 10:14:49.698: E/AndroidRuntime(8102): java.lang.IllegalStateException: Recursive entry to executePendingTransactions
06-01 10:14:49.698: E/AndroidRuntime(8102): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1416)

Solution was to replace the following line:

FragmentPagerAdapter adapter = new PagerAdapter(getActivity().getSupportFragmentManager());

with:

FragmentPagerAdapter adapter = new PagerAdapter(

getChildFragmentManager());

Geen opmerkingen:

Een reactie posten