Saturday, 15 March 2014

android - How can I store an ArrayList in SharedPreferences -



android - How can I store an ArrayList in SharedPreferences -

whats quickest way of storing object without using database?

for illustration want store list can go , add together or remove hotels to/from don't want create database , hassle seems overkill.

how can store arraylist in shared preferences or easy?

public class hotel{ string id, name, address, phonenumber; public string getname(){ homecoming name; } etc }

my advice:

use gson convert type of object string save string in sharedpreferences reverse process using gson retrieve object

android

No comments:

Post a Comment