Using Gson to parse Json array and object with no name

前端 未结 4 1109
执念已碎
执念已碎 2021-02-15 23:02

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:51

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

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

提交回复
热议问题