title: Change value(s) of clicked item inside a RecyclerView
body: <p>I have created a RecyclerView which inflates three text views and an image view from a xml file. I would like to know how can I change (update) the values of the view that has been clicked? </p>
  
  <p>So far I have set up the OnItemTouchListener which works fine, I can use it to detect which view has been clicked from within it. I don't know where to go from here, how do I change the data in the clicked view without inflating the whole RecyclerView again? I have used <a href="http://hmkcode.com/android-simple-recyclerview-widget-example/" rel="nofollow"><strong>this</strong></a> tutorial to start with RecyclerView.</p>
  
  <p>I have tried searching stackoverflow and gave google a shot but found nothing relevent. </p>
  
  <p>EDIT:</p>
  
  <p>I am inflating the RecyclerView with ItemData:</p>
  
  <pre><code>ItemData itemsData[] = {
              new ItemData(getString(R.string.upgrade1_title),R.drawable.upgrade1image,getString(R.string.upgrade1_description),getString(R.string.upgrade1_price)),
              new ItemData(getString(R.string.upgrade2_title),R.drawable.upgrade2image,getString(R.string.upgrade2_description),getString(R.string.upgrade2_price)),
              new ItemData(getString(R.string.upgrade3_title),R.drawable.upgrade3image,getString(R.string.upgrade3_description),getString(R.string.upgrade3_price)),
  </code></pre>
  
  <p>ItemData class setters &amp; getters</p>
  
  <pre><code>public class ItemData {
  
  private String title;
  private String description;
  private String price;
  private int imageUrl;
  
  public ItemData(String title,int imageUrl, String desciption, String price){
  
      this.title = title;
      this.description = desciption;
      this.price = price;
      this.imageUrl = imageUrl;
  }
  
  public CharSequence getTitle() {
      return title;
  }
  
  public void setTitle(String title) {
      this.title = title;
  }
  // The rest were removed to save space in the question
  </code></pre>
  
  <p>And finally the adapter</p>
  
  <pre><code>public class MyAdapter extends RecyclerView.Adapter&lt;MyAdapter.ViewHolder&gt; {
  private ItemData[] itemsData;
  
  public MyAdapter(ItemData[] itemsData) {
      this.itemsData = itemsData;
  }
  
  // Create new views (invoked by the layout manager)
  @Override
  public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
                                                 int viewType) {
      // create a new view
      View itemLayoutView = LayoutInflater.from(parent.getContext())
                             .inflate(R.layout.custom_row, null);
  
      // create ViewHolder
  
      ViewHolder viewHolder = new ViewHolder(itemLayoutView);
      return viewHolder;
  }
  
  // Replace the contents of a view (invoked by the layout manager)
  @Override
  public void onBindViewHolder(ViewHolder viewHolder, int position) {
  
      // - get data from your itemsData at this position
      // - replace the contents of the view with that itemsData
  
      viewHolder.txtViewTitle.setText(itemsData[position].getTitle());
      viewHolder.txtViewDescription.setText(itemsData[position].getDesciption());
      viewHolder.txtViewPrice.setText(itemsData[position].getPrice());
      viewHolder.imgViewIcon.setImageResource(itemsData[position].getImageUrl());
  
  }
  
  // inner class to hold a reference to each item of RecyclerView 
  public static class ViewHolder extends RecyclerView.ViewHolder {
  
      public TextView txtViewTitle, txtViewDescription, txtViewPrice;
      public ImageView imgViewIcon;
  
      public ViewHolder(View itemLayoutView) {
          super(itemLayoutView);
          txtViewTitle = (TextView) itemLayoutView.findViewById(R.id.textTitle);
          txtViewDescription = (TextView) itemLayoutView.findViewById(R.id.textDescription);
          txtViewPrice = (TextView) itemLayoutView.findViewById(R.id.textPrice);
          imgViewIcon = (ImageView) itemLayoutView.findViewById(R.id.imageIcon);
      }
  }
  
  public void updateListValues (int position, int newVal) {
  
  }
  // Return the size of your itemsData (invoked by the layout manager)
  @Override
  public int getItemCount() {
      return itemsData.length;
  }
  }
  </code></pre>