In shared preferences how to store string array in android application
问题 In my application am using list view in base adapter. when i click the item its id store in shared preferences string array format. how to save multiple item id in string array format [1,2,5,6] like this 回答1: You can try using JSONArray as JSON is light-weight also, you can create a JSONArray and write it to SharedPreference as String. To write, SharedPreferences prefs = PreferenceManager .getDefaultSharedPreferences(this); JSONArray jsonArray = new JSONArray(); jsonArray.put(1); jsonArray