title: refresh view in adapter class android
body: <p>i want to update textview when spinner item selection in adapter class but it show updation in wrong item's price . i have lost many time to solve this here is my code</p>
  
  <pre><code> ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(activity, android.R.layout.simple_dropdown_item_1line, arraylist.get(position).getProductUnit1());
  
          // Setting the array adapter containing country list to the spinner widget
          holder.tvproductBrandName.setAdapter(adapter);
  
          OnItemSelectedListener countrySelectedListener = new OnItemSelectedListener() {
  
              @Override
  
              public void onItemSelected(AdapterView&lt;?&gt; spinner, View container,
                      int position2, long id) {
  
                   i =Float.parseFloat(arraylist.get(position).getProductMRP1()[position2]);
  
  
  
                   holder.tvProductMRP.setText((arraylist.get(position).getProductMRP1()[position2]));
  
                  holder.tvProductOriginalPrice
                  .setText("Rs: "
                          + ((i -  Float.valueOf(arraylist.get(position)
                                          .getOfferValue()))*(Float.valueOf(arraylist.get(position).getProductQTY()))) + "");
  
  
                   OriginaiPrice =String.valueOf (i -  Float.valueOf(arraylist.get(position)
                          .getOfferValue()));
  
  
                  appSession.setProductOriginal(OriginaiPrice);
  
  
              }
  
              @Override
              public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
                  // TODO Auto-generated method stub
              }
          };
  
  
          // Setting ItemClick Handler for Spinner Widget
          holder.tvproductBrandName.setOnItemSelectedListener(countrySelectedListener);
  </code></pre>