2017-08-21 70 views
-4
"status": true, 
    "data": { 
    "teachers_per_page": 15, 
    "teachers_show_from": 0, 
    "teachers_found": 142, 
    "teachers": { 
     "0": { 
     "id": "249", 
     "name": "MD. SHAHJAHAN KABIR", 
     "position": "Assistant Professor", 
     "department": "Computer Science And Engineering", 
     "campus": "Green Road", 
     "mobile": "01719005174", 
     "email": "[email protected]", 
     "photo": "http://www.diu.ac/ephoto/11384247470513269340.jpg", 

     "Offday": "monday" 
     }, 
     "1": { 
     "id": "247", 
     "name": "Bushra Ferdousi", 
     "position": "Assistant Professor", 
     "department": "Business Administration", 
     "campus": "Banani" 
     "mobile": "01911519737", 
     "email": "[email protected]", 
     "photo": "http://www.diu.ac/ephoto/11384247160483915267.jpg", 

     "Offday": "monday" 

嘿,夥計們,這是我的JSON data.how可以從多圖片地址顯示的文字和圖像顯示圖像url中的文本和圖像形式json?

+1

你應該先給看看這個:https://stackoverflow.com/help/how-to-answer –

回答

0

教師」最好是一個jsonArray。這樣你就不需要在裏面編號。

現在來回答你。 假設你的json的根是一個jsonObject。

JSONObject root = ...// JSONObject data = root.getJSONObject("data"); JSONObject teachers = data.getJSONObject("teachers"); JSONObject teacher = teachers. getJSONObject("0");