任何人都可以請幫我把這個JSON轉換成Java對象。我通常使用GSON,但似乎這次它不適合我。問題是,我想創建一個包含Json to java對象android?
Class JsonGotText{
String status;
List<Object> result;
}
但在列表中的所有對象都是差屬性的對象......所以我不知道該怎麼做才能讓GSON地圖它正確
{
"status": 0,
"result": {
"1346053628": {
"type": "default",
"decorated_time": 1346053628,
"guidOwner": 13716,
"friendGuid": 3264,
"action_type": "friend",
"summary": " is now a friend with ",
"annotation": null,
"group": ""
},
"1346051675": {
"type": "event",
"decorated_time": 1346051675,
"guidOwner": 90,
"title": null,
"action_type": "event_relationship",
"summary": "river:event_relationship:object:event",
"annotation": null,
"group": ""
},
"1346048488": {
"type": "event",
"decorated_time": 1346048488,
"guidOwner": 90,
"title": null,
"action_type": "event_relationship",
"summary": "river:event_relationship:object:event",
"annotation": null,
"group": ""
}
}
}
在你的JSON的「結果」的對象應該是一個數組。 – Sayyam
是的,我認爲是這樣,但問題是在存儲差異對象的數組... ...你有什麼想法嗎? – vhong