0

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).

David Corsalini
  • 7,958
  • 8
  • 41
  • 66

1 Answers1

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();
Community
  • 1
  • 1
Waza_Be
  • 39,407
  • 49
  • 186
  • 260