title: I would like to spinner in recycle view list in android
body: <p>I have retrieve data from json and set in onbind in recycle list view like
  how can add value in spinner product.setQuantity(quantity); for each row </p>
  
  <pre><code>private ArrayList&lt;ProductBySubCategory&gt; parseJSONResponse(JSONArray response) {
      ArrayList&lt;ProductBySubCategory&gt; listProducts = new ArrayList&lt;ProductBySubCategory&gt;();
      if (response != null &amp;&amp; response.length() &gt; 0) {
          try {
              StringBuilder data = new StringBuilder();
              JSONArray jsonArray = response;
              for (int i = 0; i &lt; jsonArray.length(); i++) {
                  JSONObject jsonObject = jsonArray.getJSONObject(i);
                  String pName = jsonObject.getString(KEY_NAME);
                  String pPrice = jsonObject.getString(KEY_PRICE);
                  String pUrlThumbnail = AppConfig.URL_THUBMNAIL_BASE + jsonObject.getString(KEY_THUMBNAIL);
                  String pSNo = jsonObject.getString(KEY_SNO);
                  String sellerName = jsonObject.getString(KEY_SELLER_NAME);
                  String qrValue = jsonObject.getString(KEY_QRVALUE);
                  String quantity = jsonObject.getString(KEY_QUANTITY);
  
                  data.append(pName + " " + pPrice + " " + pUrlThumbnail + " " + pSNo + " " + sellerName +" "+qrValue+ " "+quantity+ "\n");
  
                  ProductBySubCategory product = new ProductBySubCategory();
                  product.setpName(pName);
                  product.setSellerName(sellerName);
                  product.setQrValue(qrValue);
                  product.setpPrice(getString(R.string.material_icon_rupees)+pPrice);
                  product.setpUrlThumbnail(pUrlThumbnail);
                  product.setpSNo(pSNo);
                  product.setQuantity(quantity);
                  listProducts.add(product);
              }
              Log.d("Lifecycle2", listProducts.toString());
          } catch (JSONException e) {
              Log.d("Lifecycle", "Inside JSON EXCEPTION: " + e);
          }
      }
      return listProducts;
  }
  </code></pre>
  
  <p>In above code i want to quantity in spinner for each row.</p>
  
  <p>I have set value in adapter in below code but I didn't set quantity in text view because I want to this value set in spinner and I have array value for spinner for each product in list and now what should I do for set value in spinner like this image for each item if possible please give me some code.
  <a href="https://i.stack.imgur.com/qsWAU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qsWAU.png" alt="enter image description here"></a></p>
  
  <pre><code>@Override
  public void onBindViewHolder(final ViewHolderProducts holder, int position) {
      ProductBySubCategory currentProduct = productArrayList.get(position);
      holder.productName.setText(currentProduct.getpName());
      holder.sellerName.setText(currentProduct.getSellerName());
      holder.qrValue.setText(currentProduct.getQrValue());
      holder.productPrice.setText(currentProduct.getpPrice());
  
      holder.btnBuy.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
              RelativeLayout relativeLayout = (RelativeLayout) view.getParent();
              TextView textView = (TextView) relativeLayout.findViewById(R.id.qrValue);
              String qrText = (String) textView.getText();
              Log.d("Abhinav", "qrValue" +qrText);
              if (buyItemClickListener != null) {
                  buyItemClickListener.buttonClicked(qrText);
              }
          }
      });
      String urlThumbnail = currentProduct.getpUrlThumbnail();
      if (urlThumbnail != null) {
          imageLoader.get(urlThumbnail, new ImageLoader.ImageListener() {
              @Override
              public void onResponse(ImageLoader.ImageContainer response, boolean b) {
                  holder.productThumbnail.setImageBitmap(response.getBitmap());
              }
  
              @Override
              public void onErrorResponse(VolleyError volleyError) {
  
              }
          });
      }
  }
  </code></pre>