我的JSON看起來像這樣。我只需要在片段的佈局中設置這些值。以便顯示有關此產品的詳細信息。如何將json數據顯示到android佈局中?
{
"adid": 5,
"uid": 1130,
"userName": "Maëly",
"cid": 5,
"brand": null,
"model": null,
"title": "Nummular dermatitis",
"description": "Nam sa dea ss "
"address": "9795 Debra Center",
"price": 1544,
"photo1": "../../../img/mobile/oneplus/3t/3t-1.jpg",
"photo2": null,
"photo3": null,
"photo4": null,
"ip_add": null,
"created": 1493921700000,
"expiryDate": null,
"published": true,
"sold": null,
"featured": true,
"cond": true,
"price_neg": true,
"used_for": "8",
"views": 1575,
"city": "Kathmandu",
"landmark": null,
"quality": null,
"alert": null,
"features": [
]
}
添加你的代碼你試過。 –
請參閱下面的鏈接幫助[json to refrofit轉換](https://stackoverflow.com/questions/42623437/parse-json-array-response-using-retrofit-gson) –
MuthuKrishnan先生,我有一個pojo類, ApiInterface和ApiClient以及帶有片段活動的空白片段來顯示結果。我添加了一些代碼。 –