我有一个相当于的 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); 但不起作用