I am working in android. I want to make sharedpreference in my code, but i dont know the way by which i can make a sharedpreference for array and how can use the value of that sharedpreference in another class.
This is my array in one for loop :- urls[i]=sitesList.getWebsite().get(i);
i want to make share preference of this urls[] array. please suggest me how can i write code to declare sharedpreference and how can i retrieve value of that sharedpreference ?
Thank you in advance.
putStringSet
andgetStringSet
are only available in API 11.Alternatively you could serialize your arrays using JSON like so:
Set and retreive your URLs like so: