【发布时间】:2015-05-19 14:27:29
【问题描述】:
其实,我想这样解析json:
{
"contents": [
{
"type": "image",
"data": {
"attachment": "picurl",
"width": 600,
"height": 398
}
},
{
"type": "text",
"data": "something like xxx"
}
]
}
如您所见,关键的“数据”有时是一个String,而sometings是json对象,我应该怎么做才能让Gson解析这个json?
【问题讨论】:
-
使用自定义反序列化器怎么样?
-
我会试试的!