Android onResume显示活动的先前状态 [英] Android onResume Show Previous state of Activity
问题描述
在我的项目中,我的活动listView checkboxes and textboxes
中的多个选项卡中有多个controls
现在我按主页键或接听电话时看到的内容我的活动暂停了
并重置控件(例如listview
将必须重新绑定&复选框未选中)
为了防止它,我设置了saveEnabled = "true"
但它does not work for listview
现在,我将不得不再次重新绑定选项卡并再次填充列表视图
In my project I've several controls
in my activity listView checkboxes and textboxes
in several tabs
now what i've seen when i press home key or recieve a call my activity put into pause
and the control get reset (like listview
will have to rebind & checkbox get unchecked)
to prevent it i set saveEnabled = "true"
but it does not work for listview
Now i'll have to rebind my tabs again and fill the listview again
告诉我有什么方法可以保存我的当前状态,onResume可以恢复上一个状态.
tell me is there any method which will save my current state and onResume will resume the previous one.
推荐答案
您应将状态保存在onPause()
方法中,然后可以在onResume()
You should save your state in onPause()
method and you can refresh your view in onResume()
这篇关于Android onResume显示活动的先前状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!