I need to provide my users the ability to add buttons to a screen. These buttons will have a standard action (send an sms with a predefined text). How should i save those items? They will have a name and a text, could be deleted and MAYBE dragged to change position. Should I use sqlite and a listview with a loader or just sharedpreferences (but i don't know how in this case) with the buttons added programmatically to the layout. The number of items will be really small (in most cases <10) so the work for sqlite seems a bit too much (and i wouldn't like to use the listview).
Asked
Active
Viewed 69 times
0
-
Did you find my answer helpful? – Waza_Be Sep 08 '12 at 08:09
-
No, i went for the database way! Thank you anyway! – David Corsalini Sep 08 '12 at 14:43
-
Would be nice id you told me or at least vote for the answer... I like to help people but I don't don't like to spend my time for nothing... – Waza_Be Sep 09 '12 at 10:23
1 Answers
0
This answer seems to be the best for you! (from what I understood from your question)
https://stackoverflow.com/a/4955428/327402
It show how you can store a pair String-String in preferences.
The alternative would be to save it in the memory:
File file = new File(getDir("data", MODE_PRIVATE), "map");
ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(file));
outputStream.writeObject(map);
outputStream.flush();
outputStream.close();