hunterp
hunterp

Reputation: 15986

How to persist nested Bundle in 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.

Upvotes: 5

Views: 1524

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007464

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

Upvotes: 4

Related Questions