3 回答
TA贡献1789条经验 获得超8个赞
Fragment
Force Closing
Activity
saveInstance
@Overrideprotected void onSaveInstanceState(Bundle outState) { //No call for super(). Bug on API Level > 11.}
.super()
编辑:
outState
Bundle
@Overrideprotected void onSaveInstanceState(Bundle outState) { outState.putString("WORKAROUND_FOR_BUG_19917_KEY", "WORKAROUND_FOR_BUG_19917_VALUE"); super.onSaveInstanceState(outState);}
EDIT 2:Activity
commitAllowingStateLoss()
EDIT 3:
绝不可能
commit()
之后的交易 onPause()
前蜂窝,和 onStop()
后蜂窝 在内部提交事务时要小心 Activity
生命周期方法 使用
onCreate()
,onResumeFragments()
和 onPostResume()
避免在异步回调方法中执行事务 使用 commitAllowingStateLoss()
只是作为最后的手段
TA贡献1796条经验 获得超4个赞
onSaveInstanceState()
AsyncTask
Thread
onSaveInstanceState()
- 3 回答
- 0 关注
- 633 浏览
添加回答
举报