Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to persist nested Bundle in Android?

Tags:

android

I have a Bundle with a nested nature that I want to preserve, how can I persist the whole Bundle most easily? SharedPreferences lacks a bundle feature.

like image 491
hunterp Avatar asked Oct 10 '22 19:10

hunterp


1 Answers

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.).

like image 152
CommonsWare Avatar answered Oct 14 '22 02:10

CommonsWare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!