Save ArrayList to SharedPreferences

前端 未结 30 3561
野的像风
野的像风 2020-11-21 04:43

I have an ArrayList with custom objects. Each custom object contains a variety of strings and numbers. I need the array to stick around even if the user leaves

30条回答
  •  梦毁少年i
    2020-11-21 05:12

    best way is that convert to JSOn string using GSON and save this string to SharedPreference. I also use this way to cache responses.

提交回复
热议问题