无法解决Fragments回堆栈的问题。当我尝试弹出时,它会抛出错误:
无法找到课程 'android.support.v4.app.FragmentTransitionCompat21 $ 1',引用自 方法android.support.v4.app.FragmentTransitionCompat21.setEpicenter 找不到课 'android.support.v4.app.FragmentTransitionCompat21 $ 3',引用自 方法 android.support.v4.app.FragmentTransitionCompat21.setSharedElementEpicenter
并再次反击,它崩溃了。
我的代码:
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.fragment_place, fragment, fragmentTag);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
Pop:
int stackCount = getSupportFragmentManager().getBackStackEntryCount();
if (stackCount > 0) {
getSupportFragmentManager().popBackStackImmediate();
}