2014-03-14 73 views
-2

Iam從某個url獲取JSON響應。此回覆包含一些文字和圖片網址。將JSON數組顯示爲ListView android

我想創建一個ListView,我可以在其中顯示縮略圖圖像,標題和一些說明。

我該怎麼做?

我的JSON -

[ 
{ 
     "SourceId": "ea9c86e1-c638-45dd-9619-8d7053458a48", 
     "ArticleGuid": "5bd475e8-945f-444b-93d5-7a1a0d757557", 
     "Url": "https://zsome/DispForm.aspx?ID=1", 
     "Title": "something", 
     "Body": "<div><p>​<img alt=\"_MG_2375-58.jpg\" src=\"some/_MG_2375-58.jpg\" style=\"margin&#58;5px;width&#58;266px;vertical-align&#58;auto;float&#58;left;\" /></p><font size=\"3\"><p> blah blah", 
     "EnterpriseKeywords": "", 
     "ThumbnailPath": "https://some.net/5bd475e8-945f-444b-93d5-7a1a0d757557/_MG_2375-58.jpg", 
     "ThumbnailDescription": "", 
     "ImageUrls": "someurl/-58.jpg", 
     "ImageBlobUrls": "some/475e8-945f-444b-93d5-7a1a0d757557/_MG_2375-58.jpg", 
     "isPlaceHolderForThumbnail": false, 
     "PublishedDate": "2014-03-02T15:39:00Z", 
     "NumberOfComments": 9, 
     "NumberOfViews": 13, 
     "CreatedDate": "2014-03-03T00:43:08Z", 
     "AuthorEncodedAccountName": "acnanjak", 
     "AuthorDisplayName": "abc", 
     "ID": 1, 
     "SourceTitle": "New", 
     "SourceUrl": "https://xome.com" 
    }, 
    { 
     "SourceId": "ea9c86e1-c638-45dd-9619-8d7053458a48", 
     "ArticleGuid": "5bd475e8-945f-444b-93d5-7a1a0d757557", 
     "Url": "https://zsome/DispForm.aspx?ID=1", 
     "Title": "something", 
     "Body": "<div><p>​<img alt=\"_MG_2375-58.jpg\" src=\"some/_MG_2375-58.jpg\" style=\"margin&#58;5px;width&#58;266px;vertical-align&#58;auto;float&#58;left;\" /></p><font size=\"3\"><p> blah blah", 
     "EnterpriseKeywords": "", 
     "ThumbnailPath": "https://some.net/5bd475e8-945f-444b-93d5-7a1a0d757557/_MG_2375-58.jpg", 
     "ThumbnailDescription": "", 
     "ImageUrls": "someurl/-58.jpg", 
     "ImageBlobUrls": "some/475e8-945f-444b-93d5-7a1a0d757557/_MG_2375-58.jpg", 
     "isPlaceHolderForThumbnail": false, 
     "PublishedDate": "2014-03-02T15:39:00Z", 
     "NumberOfComments": 9, 
     "NumberOfViews": 13, 
     "CreatedDate": "2014-03-03T00:43:08Z", 
     "AuthorEncodedAccountName": "acnanjak", 
     "AuthorDisplayName": "abc", 
     "ID": 1, 
     "SourceTitle": "New", 
     "SourceUrl": "https://xome.com" 
    }] 
+0

什麼問題..? 只是根據您的需要解析數據並創建自定義適配器並進行設置。 –

+0

@ user1632209我有它的圖像,我無法理解如何顯示它 – user3354605

回答

0

有可自定義庫從路徑加載圖像。 你可以使用Picaso加載圖像,或者你可以參考這個Tutorial

只要嘗試它,如果你得到錯誤,你可以發佈你的logcat的更多的幫助。

謝謝。