如何解析无需任何改造JSON对象数组? [英] How to parse JSON array without any object in Retrofit?
本文介绍了如何解析无需任何改造JSON对象数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我与改造和GSON工作。我有一个JSON响应作为JSON数组,但我不知道如何使用模型类来分析它。我的回答如下:
[
一,
二,
三,
四,
五,
六,
七,
八
]
解决方案
就在回调调用的字符串列表,它应该做的工作......
新的回调<名单,LT;弦乐>>()。
I am working with Retrofit and GSON. I have a JSON response as a JSON array but I don't know how to parse it by using a model class. My response is as follows:
[
"One",
"Two",
"Three",
"Four",
"Five",
"Six",
"Seven",
"Eight"
]
解决方案
Just call in the callback a list of Strings and it should do the job...
new Callback<List<String>>().
这篇关于如何解析无需任何改造JSON对象数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文