title: put value in jsonArray in android
body: <p>I am trying to put jsonobject in jsonarray so that i can display the selected item.I tried but values are getting overwrite. Please help</p>
  
  <pre><code>if(myPrefs.getInt("product"+productBean.getProductId() + productBean.getSkuId1(),0)&lt;10) {
                          qtyValues = myPrefs.getInt("product" + productBean.getProductId() + productBean.getSkuId1(), 0);
                          qtyValues = qtyValues + 1;
                          editor.putInt("product" + productBean.getProductId() + productBean.getSkuId1(), qtyValues);
                          editor.commit();
                          holder.qtyCounter.setText(myPrefs.getInt("product" + productBean.getProductId() + productBean.getSkuId1(), 0) + "");
                          value = productBean.getProductPrice();
                          add(addItem);
                          amount(value);
                          System.out.println("ProductAdapter.isSKU------------========================" + ProductAdapter.isSKU);
                          setCartItem(productBean.getSkuId1(),myPrefs.getInt("product" + productBean.getProductId() + productBean.getSkuId1(), 0),productBean.getProductId(),productBean.getDescription() , productBean.getProductName() , productBean.getProductPrice());
                      }
  
  jsonObject = new JSONObject();
      try {
          jsonObject.put("skuId",skuId);
          jsonObject.put("quantity",qty);
          jsonObject.put("productId",productId);
          jsonObject.put("price",price);
          jsonObject.put("productName",productName);
          jsonObject.put("description",description);
  
          editor.putString("data",jsonObject.toString());
          editor.commit();
          }catch (JSONException e){
              e.printStackTrace();
      }
  </code></pre>