1
數組我需要使用GSON解析用下列JSON解析嵌套JSON陣列使用GSON
[
"foo",
[
"foot mercato",
"football",
"foot center",
"foorzik",
"footao"
]
]
在Java。
林價值觀真正感興趣的陣列: 到目前爲止,我曾嘗試:
String jsonStr = "[" + "\"foo\"," + " [" + " \"foot mercato\"," + " \"football\"," + " \"foot center\"," +
" \"foorzik\"," + " \"footao\"" + " ]" + "]";
JsonParser parser = new JsonParser();
JsonArray array = parser.parse(jsonStr).getAsJsonArray();
什麼建議嗎?