Hi I am using `json` parsing, I am getting `json` response from backend and parsing is working well. but the issue is that when I try to set data as per response it sets last index only. Following is my snippet code and `json` response can any one help me with this please.

Right now it shows output 

(in my first textview)  

Buy 12 Canex + 1 Dose Free  

(in my second textview)  

Buy 12 Canex + 1 Dose Free 

```
{
  "Data": {

    "shippingText": "heyy",
    "productOffersList": [
      {
        "bgColorA": "#ffffff",
        "bgColorI": "255*255*255",
        "offerLine": [
          {
            "text": "BUY 6",
            "colorA": "#82d7ff",
            "colorI": "130*215*255"
          },
          {
            "text": " Canex + 1 Dose Free",
            "colorA": "#ff8282",
            "colorI": "255*130*130"
          }
        ]
      },
      {
        "bgColorA": "#ffffff",
        "bgColorI": "255*255*255",
        "offerLine": [
          {
            "text": "BUY 12",
            "colorA": "#65dd63",
            "colorI": "101*221*99"
          },
          {
            "text": " Canex + 1 Dose Free",
            "colorA": "#ff8282",
            "colorI": "255*130*130"
          }
        ]
      }
    ]

  },
  "Status": 1,
  "Message": "",
  "UserMessage": ""
}

```

Code

```
JSONArray productOffersList=drawerdatas.getJSONArray("productOffersList");
  for(int k=0;k<productOffersList.length();k++)
                    {

                        JSONObject joofer = productOffersList.getJSONObject(k);
                        JSONArray offerLine=joofer.getJSONArray("offerLine");

                        offertextlist=new ArrayList<ProductOffersModel>();

                        for(int l=0;l<offerLine.length();l++)
                        {
                            JSONObject jooferline = offerLine.getJSONObject(l);
                            ProductOffersModel pom=new ProductOffersModel();
                            pom.setProductOffers_text(jooferline.getString("text"));
                            pom.setProductOffers_colorA(jooferline.getString("colorA"));
                            offertextlist.add(pom);
                        }

                    }

    for(int v=0;v<offertextlist.size();v++)
                {
                    product_view_offertextfirst.setText(offertextlist.get(v).getProductOffers_text()+" "+offertextlist.get(v).getProductOffers_text());
                }  

                   for(int v=0;v<offertextlist.size();v++)
                {
                    product_view_offertexttwo.setText(offertextlist.get(v).getProductOffers_text()+" "+offertextlist.get(v).getProductOffers_text());
                }

```
['https://Stackoverflow.com/questions/47222510', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4817574/']
try with this parsing,

```
JSONArray productOffersList=drawerdatas.getJSONArray("productOffersList");
for(int k=0;k<productOffersList.length();k++)
                {

                    JSONObject joofer = productOffersList.getJSONObject(k);
                    JSONArray offerLine=joofer.getJSONArray("offerLine");

                    offertextlist=new ArrayList<ProductOffersModel>();
                    ProductOffersModel pom=new ProductOffersModel();

          pom.setProductOffers_text
           (offerLine.getJSONObject(0).getString("text")+""+
           offerLine.getJSONObject(1).getString("text"));

           offertextlist.add(pom);
                  }

    for(int v=0;v<offertextlist.size();v++)
         {

    if(v==0)
       {
       product_view_offertextfirst.setText
       (offertextlist.get(v).getProductOffers_text());
       }
     else if(v==1)   
         {
        product_view_offertexttwo.setText(
        offertextlist.get(v).getProductOffers_text());
      } 
    }

```
Handling JSON data manually is not a recommended practice for large datasets. You should go with a JSON parsing library, Gson may be a good choice.

<https://github.com/google/gson>