2 ms·
No, you don't understand. The state is serialized and stored. You might navigate away or pop into a windowed state. These things might rebuild your activity
by jayd16 10y ago
No, you don't understand. The state is serialized and stored. You might navigate away or pop into a windowed state. These things might rebuild your activity and the idea is your state should be serializable. The idea is every activity can be restarted outside of your control and your state should be fully storable.
- sidlls 10y agoNo, I understand the Android Activity lifecycle quite well. I think it has severe flaws from a design perspective.
- AstralStorm 10y agoNot from design, no. Design is pretty sound. It has implementation issues - you get to use a crusty ContentProvider or manually serialize everything into also crusty Bundle. Then you have that separate SharedPreferences thing. Or you can do it on your own, typically more cleanly, with an object database. Instead it would be often fine if it just took a Java Serializable and ran with it, just call you back so that you can read all the state and redo whatever you need to redo. Likewise IPC with Intents is pretty crusty as is with Binder, though bit less with the latter.