I wanna know whether is it possible to store array of string in the SharedPreferences. In my application i want , set of names to be stored. I know this can be done using DB,i just wanna know whether is it possible to save those set of name as array of strings in the SharedPreferences.
Share
You can store set of String using
SharedPreferencesin API Level 11 and higher. SeegetStringSet()andputStringSet()юIn API Level prior to 11 you can use some kind of hack. For example, if you need to store string array under key “stringArray”, you can save each string from array using
putStringand keys “stringArray.1”, “stringArray.2”, so on.