这是负责将片段添加到返回栈的函数:
public void populateContent(File f)
{
ContentFragment cf = new ContentFragment(ctx, ac, this);
FragmentTransaction transaction = ac.getSupportFragmentManager().beginTransaction();;
cf.updateView(f);
transaction.replace(R.id.contentFragment, cf);
transaction.addToBackStack(null);
transaction.commit();
}
当我点击后退按钮时,上一个片段没有加载(什么也没有发生)。
您有什么想法是什么原因造成的?
编辑:FragmentManager日志。
我觉得我的应用程序似乎保存了第二个视图两次,而不是先保存第一个视图,然后再保存第二个视图。