android application/activity life cycle: when should we save to flash?

半腔热情 提交于 2019-12-06 09:22:02

I save at every onPause and restore in every onResume. This prevents some oddities if you have multiples of the same activity on the stack.

Most Google apps do this as well, or save to an intermediate location if you want to prompt for saving normally.

If it's not causing performance issues and meets your requirements for maintainability then it's probably good enough.

You could implement Application class and use this callback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!