Gson - putting and getting ArrayList of composite objects
问题 I have class NameAndPostion in which I am going to store name and position of users. And I have created ArrayList of objects of NameAndPosition . ArrayList<NameAndPosition> LocSenders = new ArrayList<NameAndPosition>(); Now I have converted LocSenders into JSON string by using Gson library Gson gson = new Gson(); String json = gson.toJson(LocSenders); I did this conversion to save LocSenders in Shared Pref. Now I want to retrieve all objects in 'LocSenders' which I have stored using Gson JSON