Reputation: 1525
In my Android application, I need to make a list of favorite items. Each of these items consists of 3 key/value pairs. I want a dynamic array capable of:
Any suggestions?
Upvotes: 0
Views: 68
Reputation: 2533
Use ArrayList
for the first 3 dots, for the last, override the toString()
method and write the result to a file.
Upvotes: 0
Reputation: 359936
SharedPreferences
sounds perfect given your requirements.
The
SharedPreferences
class provides a general framework that allows you to save and retrieve persistent key-value pairs of primitive data types. You can useSharedPreferences
to save any primitive data: booleans, floats, ints, longs, and strings. This data will persist across user sessions (even if your application is killed).
Upvotes: 1