I'm making an application that has to share a lot (relatively) of data between activities. At first I was passing the data between activities by serialising it or making it parcelable, but it got messy pretty fast (especially when I need to preserve data when a user presses BACK). Now I decided to use the Application class to store it in a global singleton. Now it got a lot cleaner and much more simple (and this is the main reason why I want to do it). Not that it's relevant but it's a restaurant ordering application and the data I'm storing as global is:
- A list of all menu items in categories. HashMap < Integer, ArrayList> (I get them from a server so it might change between launches).
- The cart with all the stuff a user added to it HashMap < Integer, HashMap >
- A simple string.
The question is simple: How would the "big boys" do this? Am I correct to use the Application class? Do I need to worry about storing too much stuff here? Should I just drop this and go with the Serializable/Parcelable stuff and constantly put them in Intent's?