我在我的项目中使用了commit方法,它使用片段构建它.
无论如何,有时我得到IllegalStateException: Can not perform this action after onSaveInstanceState错误,我找不到任何关于它的好解决方案,但只是这种方法commitAllowingStateLoss().我改变了提交功能,commitAllowingStateLoss()但没有长时间使用它进行测试,所以这个功能可以帮助我吗?而主要的问题是,commit()和之间有什么区别commitAllowingStateLoss()?