I want to fetch string values from a JSON-array and set it to a spinner in Android. How can I do this?
`{"languages":["English","Hindi","Punjabi","",""]} `languages":["English","Hindi","Punjabi","",""]}
I want to fetch string values from a JSON-array and set it to a spinner in Android. How can I do this?
`{"languages":["English","Hindi","Punjabi","",""]} `languages":["English","Hindi","Punjabi","",""]}
You can parse your JSONARRAY like this
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();
}
}
}