我在片段中制作了一个视图寻呼机,它一切正常,但每当我设置OffScreenPageLimit()对于我的寻呼机,我得到这个错误:
08-03 13:53:15.506: E/AndroidRuntime(5106): Process: com.lifemate.lmmessenger, PID:
5106
08-03 13:53:15.506: E/AndroidRuntime(5106): java.lang.IllegalStateException: Recursive
entry to executePendingTransactions
08-03 13:53:15.506: E/AndroidRuntime(5106): at
android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1450)
08-03 13:53:15.506: E/AndroidRuntime(5106): at
android.support.v4.app.FragmentManagerImpl.
executePendingTransactions(FragmentManager.java: 478)
08-03 13:53:15.506: E/AndroidRuntime(5106): at
android.support.v4.app.FragmentStatePagerAdapter.
finishUpdate(FragmentStatePagerAdapter.jav a:163)
08-03 13:53:15.506: E/AndroidRuntime(5106): at
android.support.v4.view.ViewPager.populate(ViewPager.java:1068)
08-03 13:53:15.506: E/AndroidRuntime(5106): at
android.support.v4.view.ViewPager.populate(ViewPager.java:914)
08-03 13:53:15.506: E/AndroidRuntime(5106): at
android.support.v4.view.ViewPager.setOffscreenPageLimit(ViewPager.java:695)
这是我的代码:
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
tabs = (PagerSlidingTabStrip) view.findViewById(R.id.tabs_allinone);
pager = (ViewPager) view.findViewById(R.id.pager_allinone);
adapter = new MyPagerAdapter(getFragmentManager());
Sidepanel();
RDbhelper = new RoomsDBhelper(getActivity());
mDb = RDbhelper.getWritableDatabase();
pager.setAdapter(adapter);
final int pageMargin = (int)
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4, getResources()
.getDisplayMetrics());
pager.setPageMargin(pageMargin);
tabs.setViewPager(pager);
pager.setOffscreenPageLimit(3);
super.onViewCreated(view, savedInstanceState);
任何想法为什么这个正在发生的人?