开发者

How to persist nested Bundle in Android?

开发者 https://www.devze.com 2023-03-11 19:14 出处:网络
I have a Bundle with a nested nature that I want to pr开发者_如何学编程eserve, how can I persist the whole Bundle most easily? SharedPreferences lacks a bundle feature.Don\'t use a Bundle. A Bundle is

I have a Bundle with a nested nature that I want to pr开发者_如何学编程eserve, how can I persist the whole Bundle most easily? SharedPreferences lacks a bundle feature.


Don't use a Bundle. A Bundle is not meant to be persisted. Use a different data model (POJOs, HashMap, whatever) and write persistence logic (serialize, serialize to JSON, serialize to XML, write to SQLite, etc.).

0

精彩评论

暂无评论...
验证码 换一张
取 消