Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialdlpuxdzztg
8,243 PointsSaving Custom Object Array
Hello.
I was wondering if anyone knew how to save a list of custom objects (with a String getter and setter in my case). A code example would also be very helpful.
Thank you!
dlpuxdzztg
8,243 PointsYeah, the string, in my case, is the name for the object.
1 Answer
Ben Deitch
Treehouse TeacherI think the easiest way would be to concatenate your Strings into one String, and then store/retrieve that one String using SharedPreferences. Here's a good example of this that uses a comma for the delimiter.
Ben Deitch
Treehouse TeacherBen Deitch
Treehouse TeacherHey Diego! What do you mean by String getter and setter? Are you storing Strings?