0

I want to parse multiple json object like,

This is my JSON

   {"pkOrderGroupId": 86,
          "orders": [
            {"fkProductId": 341,
              "fkMaterialId": 4,
              "fkColorId": 1,
               "productDesc": "fgsadfg",
            },
             {
              "fkProductId": 341,
              "fkMaterialId": 4,
              "fkColorId": 1,
              "productDesc": "fgsadfg",

            }
          ]
        },
        {
          "pkOrderGroupId": 85,
          "orders": [
        {
              "fkProductId": 341,
              "fkMaterialId": 4,
              "fkColorId": 1,
              "productDesc": "fgsadfg",

            }
          ]
        }

How can i parse it ???? I am trying something like ->

     JsonObjectRequest jsr = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
                    @Override
                    public void onResponse(JSONObject response) {

                        for (int i = 0 ; i<response.length();i++)
                        {
        JSONObject employee =response.getJSONObject(i); // but its not work here
        }

As shown in my Json code , it contains multiple JsonObject and inside that it contain JsonArray .

Is there any way to achieve that ??

Early Reply is appreciable

Android
  • 1,420
  • 4
  • 13
  • 23
NICK
  • 11
  • 1
  • 5

0 Answers0