If I want to pass data between activities in the same application, a) I can use an Intent
or b) use a database (passing the id in the Intent
instead of the full data.
But I could also use c) a class with static data structures that both activities can access in a store/fetch fashion.
What are the cons of using (c) if I don't care about persistence of the data on app restart?
The big cons is that the Android OS can kill your process at any time. When the process will be re-created, Android will re-create all of your activities restoring their state.
Since Android doesn't know about how your static data should be handled, you will lose it and Activity B will be in an inconsistent state.
I'll make an example to be clearer: