You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

从浏览器返回应用后出现Java.Lang.IllegalStateException异常的问题求助

从浏览器返回应用后出现Java.Lang.IllegalStateException异常的问题求助

大家好,我最近碰到个棘手的问题:用户从浏览器返回我的应用后,应用频繁崩溃,生成了一堆异常日志。我把相关日志贴出来,想请各位帮忙分析下问题出在哪:

Exception - This event error 01:31:03.392 PM Java.Lang.IllegalStateException: Can not perform this action after onSaveInstanceState
 generic info 01:31:03.378 PM [MainActivity : OnResume] Activity: onResume
 generic info 01:31:03.313 PM [<OnCreate>d__0 : MoveNext] Activity: onCreate
 Ui Lifecycle info 01:30:18.946 PM Window.Stopped
 generic info 01:30:13.985 PM [MainActivity : On...

从日志里能看到,应用先进入了Window.Stopped状态,回到应用时触发了Activity的onCreate和onResume,但紧接着就抛出了Can not perform this action after onSaveInstanceState这个异常。我知道这个异常通常和Activity保存状态后执行Fragment事务或者某些不允许的UI操作有关,但还没定位到具体是哪段代码出了问题。有没有大佬能给我一些排查方向或者解决思路呀?

备注:内容来源于stack exchange,提问作者Natalia Szatkowska

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.13 17:04:34