错误记录java.lang.IllegalStateException: Recursive entry to executePendingTransactions

fragment+viewpager在fragment使用viewpager切换

MasterAdapter adapter = new MasterAdapter(getActivity().getSupportFragmentManager(),fragments);
mVpMaster.setAdapter(adapter);
这样会报出如上的错误,

改成如下即可:

MasterAdapter adapter = new MasterAdapter(getChildFragmentManager(),fragments);
mVpMaster.setAdapter(adapter);

注意此时的Fragement使用的是v4包的Fragment

import android.support.v4.app.Fragment;


你可能感兴趣的:(错误记录)