title: Getting Wrong position of RecyclerView Item in next Fragment after applying SearchFilter and OnClick on RecyclerView Item
body: <p>I have set <code>RecyclerView</code> on Fragment.I have set <code>OnClick</code> listener for RecyclerView item from RecyclerView Adapter.I get Filtered item using <code>SearchFilter</code>.After onClick of RecyclerView Item I need to get the Item Position and pass in Bundles to Next Fragment.But I am getting wrong position after filtering item.This is code for setting Recyclerview Adapter </p>
  
  <pre><code>public class StatusAdapter extends RecyclerView.Adapter&lt;StatusAdapter.ViewHolder&gt; {
      private ArrayList&lt;CurrentEntry&gt; originalList,filterList;
      Context context;
  
      public void filter(String newText)
      {
          filterList.clear();
          if(TextUtils.isEmpty(newText))
          {
              filterList.addAll(originalList);
          }
          else
          {
              for(CurrentStatusEntry entry:originalList)
              {
                  if(entry.getName().toLowerCase().contains(newText))
                      filterList.add(entry);
              }
              notifyDataSetChanged();
          }
          //    notifyDataSetChanged();
      }
      public StatusAdapter(ArrayList&lt;CurrentEntry&gt; originalList,Context context)
      {
          this.originalList=originalList;
          this.context=context;
          this.filterList=new ArrayList&lt;CurrentEntry&gt;();
          this.filterList.addAll(this.originalList);
      }
      @Override
      public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View v= LayoutInflater.from(parent.getContext()).inflate(R.layout.current_status_card,parent,false);
          return new ViewHolder(v);
      }
  
  
       @Override
          public void onBindViewHolder(final ViewHolder holder, int position) {
              final  CurrentEntry current=filterList.get(position);
              int temppos=holder.getAdapterPosition();
              int finalPos=temppos+1;
              holder.Name.setText(current.getName());
              holder.People.setText(current.getNo());
              holder.Estimate.setText(current.getEsti());
              holder.bookTime.setText(current.getTime());
              holder.myNumber.setText(String.valueOf(finalPos));
              holder.lapsedTime.setText(current.getLapsedTime());
              holder.itemView.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      int position=holder.getAdapterPosition();
              Bundle bundle=new Bundle();
              bundle.putInt("position",position);
              StatusInfo satusInfo=new StatusInfo();
              satusInfo.setArguments(bundle);
              AppCompatActivity activity=(AppCompatActivity)v.getContext();
              activity.getSupportFragmentManager().beginTransaction().add(R.id.frame,satusInfo).addToBackStack("info").commit();
                  }
              });
          } 
  
  @Override
  public int getItemCount() {
      return (null!=filterList ? filterList.size():0);
  }  
  </code></pre>
  
  <p>This is code for my ViewHolder  </p>
  
  <pre><code>public class ViewHolder extends RecyclerView.ViewHolder {
        private   TextView Name ;
       private    TextView People;
     private      TextView Estimate;
     private      TextView myNumber;
      private     TextView bookTime;
      private     TextView lapsedTime;
          private  ViewHolder(View itemView) {
              super(itemView);
              Name=(TextView)itemView.findViewById(R.id.name);
              People=(TextView)itemView.findViewById(R.id.people);
              Estimate=(TextView)itemView.findViewById(R.id.estimate);
              myNumber=(TextView)itemView.findViewById(R.id.no);
              bookTime=(TextView)itemView.findViewById(R.id.bookTime);
              lapsedTime=(TextView)itemView.findViewById(R.id.lapsedTime);
          }
  </code></pre>
  
  <p>How to get correct position of RecyclerView item after filtering ?</p>