I have one question about android basic concepts.
I have an Activity that pass two arrays of Integers to another Activity via an Intent. One array is an array of IDs (Integers) and the other is an array of Names (String). I have all this information also in an SQLite Database.
So my question is:
What is better, passing all the info using the intent or passing only the ID’s array and take the Names directly from the database when the OnCreate of the second activity is invoke?.
Thanks.
The best approach is to send as little info through intents as possible. This will keep your code for storing / restoring data in the proper places, as well as reduce the transition time between activities.
Since you’ve already got that information stored in the DB, and already presumably have the methods to store and retrieve that information, why add more work for yourself writing code to bundle it all up for an intent? Just send the identifying info and let the rest of your framework do the work.