Activity(View)的存储与恢复
来源:互联网 发布:ae软件怎么下载 编辑:程序博客网 时间:2024/04/30 09:50
@Override protected Parcelable onSaveInstanceState() { // TODO Auto-generated method stub Bundle bundle = new Bundle(); bundle.putParcelable(Instance, super.onSaveInstanceState()); bundle.putBoolean(Instance_GameOver, IsGameOver); bundle.putParcelableArrayList(Instance_WhiteArray, whiteArray); bundle.putParcelableArrayList(Instance_BlackArray, blackArray); return bundle; } @Override protected void onRestoreInstanceState(Parcelable state) { // TODO Auto-generated method stub if(state instanceof Bundle) { Bundle bundle=(Bundle) state; IsGameOver=bundle.getBoolean(Instance_GameOver); whiteArray=bundle.getParcelableArrayList(Instance_WhiteArray); blackArray=bundle.getParcelableArrayList(Instance_BlackArray); super.onRestoreInstanceState(bundle.getParcelable(Instance)); return ; } super.onRestoreInstanceState(state); }
在打电话或者翻转屏幕可能会清空view,调用这两个方法,只需要改动里面内容即可恢复与保存。
阅读全文
0 0
- Activity(View)的存储与恢复
- Android 之View界面的存储与恢复的异常
- Activity被系统杀死,数据的存储与恢复
- Activity与View的联系
- Activity状态的保存与恢复
- 保存与恢复activity的状态
- Android tips #2 存储和恢复activity的状态
- activity 暂停与恢复
- android activity与view的联系--window
- Activity生命周期与View宽度的获取
- 数据库备份与恢复的存储过程
- 备份与恢复的存储过程
- 备份与恢复数据库的存储过程
- 备份与恢复数据库的存储过程
- 备份与数据恢复的存储过程
- Activity保存和恢复View层次结构
- 恢复删除的view
- Android中Activity执行restart过程中涉及到的四种数据存储恢复的方法(转)
- linux之nagios安装教程
- 机器学习18-XGBoost的推导过程
- web系统启动报错:mysql数据库连接many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
- 你在哪,现实就在哪
- Python3.5+PyQt5多线程+itchat实现微信防撤回桌面版代码(二)
- Activity(View)的存储与恢复
- javascript初学记1----各种玩乐的数组
- 【JAVA】通过第三方API接口地址获取信息
- ERROR : arm-linux-ld:u-boot.lds:1: ignoring invalid character `#' in expression
- 无损联接分解
- oracle函数总结
- ABAP数据库操作之操作语句Insert
- Jquery datetimepicker插件基本使用
- Python-socket的简单使用