Save an arraylist of Strings to shared preferences

后端 未结 4 1410
独厮守ぢ
独厮守ぢ 2020-12-10 14:00

What is the best way to save an ArrayList of strings to SharedPreferences in API level 8? The only way i can think of now is to save all of the str

4条回答
  •  一生所求
    2020-12-10 14:41

    There is a method, putStringSet(), in SharedPreferences.Editor, which you can take advantage of if your strings are a Set. (That is, no duplicates).

提交回复
热议问题