I am trying to parse the jsonArray
but unable to understand this format,How to parse this type of jsonArray
?
Can anyone help me?
"rows": [
[
"/farmfresh",
"20171211",
"4"
],
[
"/farmfresh/product/d",
"20171215",
"4"
],
[
"/farmfresh/product/h",
"20171222",
"2"
]
]
Try this
try
{
JSONObject resObject = new JSONObject("your json response");
JSONArray jsonArray = resObject.getJSONArray("rows");
for (int i = 0; i < jsonArray.length(); i++) {
JSONArray jsonArray1 = jsonArray.getJSONArray(i);
for (int j = 0; j < jsonArray1.length(); j++) {
Log.i("Value","->" +jsonArray1.getString(j));
}
}
}
catch (JSONException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
OUTPUT
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With