Using Gson to parse Json array and object with no name

前端 未结 4 2246
攒了一身酷
攒了一身酷 2021-02-15 23:04

I know there are many JSON with GSON questions but none of them relate to me directly. My JSON is formatted differently.

I have a JSON data I want to parse using GSON wh

4条回答
  •  太阳男子
    2021-02-15 23:43

    If you have a JsonArray like [ {..} , {..} ] you can do this with Gson:

    Item[] items = gson.fromJson(json, Item[].class);
    

提交回复
热议问题