user896780
user896780

Reputation:

android how to convert the json object to json array

i'm trying to create an application about convert the json object to json array. If it's possible means tell me the way, otherwise, tell the alternate way. Thanks in advance.

Upvotes: 1

Views: 8887

Answers (1)

Vineet Shukla
Vineet Shukla

Reputation: 24021

try this:

JSONArray jArrayObject = new JSONArray();
jArrayObject.put(getJsonObject());

private static JSONObject getJsonObject() throws JSONException {
    JSONObject jObject = new JSONObject();
    //put value jObject here..
}

Upvotes: 8

Related Questions