title: Recyclerview notifyDataSetChanged(); not working
body: <p>I have tried to delete the items from RecyclerView and update the list again using below code </p>
  
  <pre><code>public class ScannedCodesAdapter extends RecyclerView.Adapter&lt;ScannedCodesAdapter.ViewHolder&gt; {
  
  private List&lt;CodeItem&gt; mList;
  private Context mContext;
  private OnItemClickListener mClick;
  
  public ScannedCodesAdapter(List&lt;CodeItem&gt; list, Context context, OnItemClickListener click) {
      mList = list;
      mContext = context;
      mClick = click;
  }
  
  @Override
  public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      ScanProductCodeItemBinding mBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()),
              R.layout.scan_product_code_item, parent, false);
      return new ViewHolder(mBinding);
  }
  
  @Override
  public void onBindViewHolder(ViewHolder holder, int position) {
  
      CodeItem item = mList.get(position);
      String code = item.getCode();
      holder.binding.adapterCode.setText(code);
      int num = position + 1;
      if (mList != null)
          holder.binding.adapterNum.setText(num + " ");
      if ((position % 2) == 0) {
          holder.itemView.setBackgroundResource(R.color.white);
      } else {
          holder.itemView.setBackgroundResource(R.color.color2);
      }
  
      if (item.selected) {
          holder.binding.adapterDelete.setVisibility(View.VISIBLE);
      } else {
          holder.binding.adapterDelete.setVisibility(View.GONE);
      }
  
      holder.itemView.setOnClickListener(view -&gt; {
          for (CodeItem m : mList) {
              m.selected = false;
          }
          item.selected = true;
          notifyDataSetChanged();
      });
      holder.binding.adapterDelete.setOnClickListener(view -&gt;
      {
         // mClick.onClick(view, position);
          //notifyItemRemoved(position);
  
          SQLiteDataBaseHandler handler = new SQLiteDataBaseHandler(mContext);
          CodeItem codeItem = handler.getCodeItem(code);
          if (item != null) {
          handler.deleteCode(codeItem);
           notifyDataSetChanged();
      });
  
  }
  
  @Override
  public int getItemCount() {
      return mList.size();
  }
  
  public class ViewHolder extends RecyclerView.ViewHolder {
      ScanProductCodeItemBinding binding;
  
      public ViewHolder(ScanProductCodeItemBinding binding) {
          super(binding.getRoot());
          this.binding = binding;
      }
  }
  </code></pre>
  
  <p>in here recycler not updating after delete the item. 
  If I go back and come only update the list. also I tried OnItemClickListener to remove from the activity. 
   notifyDataSetChanged(); I tried this and also I tried notifyItemRemoved(position); but not working 
  Anyone suggest the idea to do this ??</p>