【发布时间】:2012-12-07 12:21:34
【问题描述】:
private static void changeFragment(Fragment f, boolean init) {
FragmentTransaction ft = fm.beginTransaction();
ft.replace(R.id.info_content, f,f.getClass().getName());
if(!init){
ft.addToBackStack(null);
}
ft.commit();
}
当我想通过调用 fm.getBackStackEntryCount() 获取堆栈 cout 时,它返回零?
【问题讨论】:
-
bool init 的值是多少?
-
无论真假,永远为零。