public class GSON { private static final String TAG = "GSON"; public class App{ private String id; public String getId(){ return id; } public void setId(String id){ this.id=id; } } private void parseJSONWithGSON(String jsonData){ Gson gson=new Gson(); List<App> appList=gson.fromJson(jsonData,new TypeToken<List<App>>(){}.getType()); for(App app:appList){ Log.d(TAG, "id:"+app.getId()); } }
【Android学习记录】GSON解析JSON
最新推荐文章于 2023-03-02 16:16:49 发布