我有一個JSON數組相當於Android的JSON小問題
{
"genre":"2",
"imported_from":"1",
"release_year":"1999",
"import":"1",
"label":"1",
"artist":"Boards Of Canada ",
"album_title":"Music Has The Right To Children",
"formats":"1"
}
我能夠通過
JSONObject jsonObject = jsonArray.getJSONObject(i);
jsonObject.optString("genre");
但我怎麼可以通過索引訪問它來獲取領域試過jsonObject.optInt(0);但一點兒也不工作