How to add multiple JSON array with same name in a JSON object?
I have tried
JSONObject jsonObject = new JSONObject(jsonHeader);
jsonObject.put("item", jsonArray1);
jsonObject.put("item", jsonArray2);
Log.i(TAG, jsonObject.toString());
and I get this result
{
...
"item":{[
jsonArray2
]}
}
but I want get the result contain all the jsonArray
{
...
"item":{[
jsonArray1
]},
"item":{[
jsonArray2
]}
}
How can I do that?
Thanks :D