源码之家

  • 首页
  • 文章
  • 问答
  • 下载
您的位置: 首页  >  文章  >  java.lang.IllegalStateException commit already called

java.lang.IllegalStateException commit already called

分类: 文章 • 2023-04-05 15:46:39

java.lang.IllegalStateException commit already called

今天使用Fragment时报如下图错误:

java.lang.IllegalStateException commit already called

分析原因

之所以报该错误,是因为 Fragment 事务是全局的变量,只能commit一次。

解决方法:

将获取Fragment事务定义为局部变量,每次提交时都去获取新的事务去commit即可。

相关推荐

  • called detach on an already detached child ViewHolder
  • java.lang.IllegalStateException: Bindings already cleared.
  • java.lang.IllegalStateException: commit already called
  • 继承DialogFragment实现Dialog闪退异常:java.lang.IllegalStateException: Fragment already added: ToastDialog
  • java.lang.IllegalStateException commit already called
  • java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' befo
  • Elasticsearch启动报错java.lang.IllegalStateException: availableProcessors is already set to [4], rejecti
  • There is already 'projectApproveController' bean method java.lang.IllegalStateException: Ambiguous
  • java.lang.IllegalStateException: BeanFactory not initialized or already closed
  • java.lang.IllegalStateException: begin() called when transaction is OPEN!
  • .Elements in iteration expect to have 'v-bind:key' directives
  • 关于IDEA的一些记录日常(一)
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 源码之家    备案号:   粤ICP备20058927号