title: Wrong item in recyclerview after filtering
body: <p>hi i have a RecyclerView adapter as follow :-</p>
  
  <pre><code>public class RecyclerViewAdapter extends RecyclerView.Adapter&lt;ViewHolder&gt; {
  
          List&lt;Data&gt; list = Collections.emptyList();
          Context context;
  
          public RecyclerViewAdapter(List&lt;Data&gt; list, Context context) {
              this.list = list;
              this.context = context;
          }
  
          @Override
          public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
              //Inflate the layout, initialize the View Holder
              View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.apps_layout, parent, false);
  
              ViewHolder holder = new ViewHolder(v);
              return holder;
  
          }
  
      @Override
      public void onViewDetachedFromWindow(ViewHolder holder) {
          super.onViewDetachedFromWindow(holder);
  
          ((ViewHolder)holder).itemView.clearAnimation();
      }
  
      @Override
          public void onBindViewHolder(ViewHolder holder, int position) {
  
              //Use the provided View Holder on the onCreateViewHolder method to populate the current row on the RecyclerView
              holder.title.setText(list.get(position).title);
              holder.description.setText(list.get(position).description);
  
          }
  
      public void setFilter(List&lt;Data&gt; searched_data) {
          list = new ArrayList&lt;&gt;();
          list.addAll(searched_data);
          notifyDataSetChanged();
      }
  
          @Override
          public int getItemCount() {
              //returns the number of elements the RecyclerView will display
              return list.size();
          }
  
          @Override
          public void onAttachedToRecyclerView(RecyclerView recyclerView) {
              super.onAttachedToRecyclerView(recyclerView);
          }
  
          // Insert a new item to the RecyclerView on a predefined position
          public void insert(int position, Data data) {
              list.add(position, data);
              notifyItemInserted(position);
          }
  
          // Remove a RecyclerView item containing a specified Data object
          public void remove(Data data) {
              int position = list.indexOf(data);
              list.remove(position);
              notifyItemRemoved(position);
          }
  
      }
  </code></pre>
  
  <p>okay now as you can see setFilter method to filter recyclerview list</p>
  
  <p>here is how i call it</p>
  
  <pre><code>searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
  
              @Override
              public boolean onQueryTextSubmit(String s) {
                 return false;
              }
  
              @Override
              public boolean onQueryTextChange(String s) {
                  List&lt;Data&gt; filteredModelList = filter(data, s);
                  adapter.setFilter(filteredModelList);
                  return true;
              }
          });
  </code></pre>
  
  <p>now filter works fine now when i click on it the position is wrong</p>
  
  <p>i know the error coming from the position as the older recyclerview on click has old position index i dont know how to fix it anyway here is onclicklistener</p>
  
  <pre><code>data = appsdata(); // load the list List&lt;Data&gt;
  
          Collections.sort(data); // sorting
  
          recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
          final LinearLayoutManager layoutManager = new LinearLayoutManager(this);
          layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
          recyclerView.setLayoutManager(layoutManager);
  
          adapter = new RecyclerViewAdapter(data, this);
          recyclerView.setAdapter(adapter);
          recyclerView.setNestedScrollingEnabled(false);
  
          recyclerView.addOnItemTouchListener(new RecyclerItemClickListener(this, recyclerView, new RecyclerItemClickListener.OnItemClickListener() {
              @Override
              public void onItemClick(View view, int position) {
  
                  String s = data.get(position).title;
                  String ss = data.get(position).description;
  
                  Intent intent = new Intent(MainAcitivity.this, Work.class);
                  intent.putExtra("title", s);
                  intent.putExtra("desc", ss);
                  startActivity(intent);
  
              }
  
          }));
  </code></pre>
  
  <p>i know this line is causing problem</p>
  
  <pre><code>String s = data.get(position).title;
  </code></pre>
  
  <p>because it is same as old when list was not filtered ,how i can update this recyclerview so that i can get updated index when launching Work.class</p>