-1
我想解析'觀衆'數組。在JSON中解析嵌套數組Java
String data = {
"meta":{
"requests":31454,
"timestamp":1456706180,
"status":200,
"message":"Request successful",
"method_id":1129,
"method":{
}
},
"data":[
{
"id":3681,
"employer":"Google",
"date":"2016-01-05",
"day":"January",
"start_time":"17:00",
"end_time":"19:00",
"description":"Info session to discuss options at Google for majors outside of Computer Science.",
"website":"http:\/\/www.google.com\/careers\/students",
"building":{
"code":"FED",
"name":"Federation Hall",
"room":"Main Hall",
"latitude":43.4732,
"longitude":-80.5485,
"map_url":"https:\/\/uwaterloo.ca\/map\/FED?basemap=D#map=17\/43.4732\/-80.5485"
},
"audience":[
"ENG - Computer",
"ENG - Electrical",
"ENG - Mechatronics",
"ENG - Software",
"ENG - System Design",
"MATH - Combinatorics & Optimization",
"MATH - Computer Science",
"MATH - Pure Mathematics"
],
"link":"http:\/\/www.ceca.uwaterloo.ca\/students\/hiresessions_details.php?id=3681"
}
}
我開始與
JSONObject obj = new JSONObject(data);
JSONArray data2 = new JSONArray(obj);
但是我不確定現在該怎麼獲得 「觀衆」 的數據?我試圖從data2創建另一個數組,但是這給了一個錯誤,所以我真的不知道如何繼續?
解釋downvote。那只是愚蠢的 – DilllyBar
Downvotes不是愚蠢的。離開也許你會得到一個錯誤。所以不會閱讀[如何在Android中解析JSON](http://stackoverflow.com/questions/9605913/how-to-parse-json-in-android) –