我想从JSON数组中获取字符串值,并将其设置为Android中的微调器。我怎么能够 做这个?
`{"languages":["English","Hindi","Punjabi","",""]} `languages":["English","Hindi","Punjabi","",""]}
答案 0 :(得分:1)
您可以像这样解析JSONARRAY
if (jsonResultArry != null) {
for (int i = 0; i < jsonResultArry.length(); i++) {
try {
JsonObject jsonPblm = jsonResultArry.getJSONObject(i);
pblmId = jsonPblm.getString("id");
ticketDate = jsonPblm.getString("ticket_date");
pblmName = jsonPblm.getString("description");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}