title: Android RecyclerView Adapter notifyDataSetChanged not working
body: <p>I have read several questions on stackoverflow addressing this problem and implented solutions, but still I cannot update items. By pressing a menu icon, searchString() is invoked. Inside this method i want to update recyclerview item which not works.  Here is related parts of my code:</p>
  
  <pre><code>    /* in my notation, pg is equivalent to page.*/
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      View view = inflater.inflate(R.layout.fragment_ebook_list, container, false);
      mEbookRecyclerView = (RecyclerView) view.findViewById(R.id.ebook_recycler_view);
      mLayoutManager = new LinearLayoutManager(getActivity());
      mEbookRecyclerView.setLayoutManager(mLayoutManager);
      updateUI();
      return view;
  }
  
  @Override
  public void onResume() {
      super.onResume();
      updateUI();
  }
  
  
  private void updateUI() {
      if (mAdapter == null) {
          EbookLab ebookLab = EbookLab.get(getActivity());
          List&lt;String&gt; pgs = ebookLab.getPgs();
          mAdapter = new EbookAdapter(pgs);
          mEbookRecyclerView.setAdapter(mAdapter);
      }
  }
  
     /* ******codes for preparation of menus which I have ignored *******/
  
     private class EbookHolder extends RecyclerView.ViewHolder {
      private String mPg;
  
      public EbookHolder(LayoutInflater inflater, ViewGroup container) {
          super(inflater.inflate(R.layout.list_item_ebook, container, false));
          mListWebView = (WebView) itemView.findViewById(R.id.list_web_View);
          mListWebView.getSettings().setLoadWithOverviewMode(true);
      }
  
      public void bindEbook(String pg) {
          mPg = pg;
          mListWebView.loadDataWithBaseURL("file:///android_asset/", mPg, "text/html", "UTF-8", null);
      }
     }
  
     private class EbookAdapter extends RecyclerView.Adapter&lt;EbookHolder&gt; {
      private List&lt;String&gt; mPgs;
      public EbookAdapter(List&lt;String&gt; pgs) {
          mPgs = pgs;
      }
      @Override
      public EbookHolder onCreateViewHolder(ViewGroup parent, int viewType)
      {
          LayoutInflater layoutInflater = LayoutInflater.from(getActivity());
          return new EbookHolder(layoutInflater, parent);
      }
  
  
      @Override
      public void onBindViewHolder(EbookHolder holder, int position) {
          String pg = mPgs.get(position);
          holder.bindEbook(pg);
      }
      @Override
      public int getItemCount() {
          return mPgs.size();
      }
      public void setPgs(List&lt;String&gt; pgs) {
          mPgs.clear();
          mPgs.addAll(pgs);
          notifyDataSetChanged();
      }
  }
  
     public void searchString(String qSrh) {
          EbookLab ebookLab = EbookLab.get(getActivity());
          List&lt;String&gt; pgs = ebookLab.getPgs();
      List&lt;String&gt; tmppgs = new ArrayList&lt;String&gt;(pgs);
  
     /** Some code for manipulation of tmppgs and updating recyclerview based on the tmppgs **/
  
     mAdapter.setPgs(tmppgs);
     }
  </code></pre>
  
  <p>Any helps is appreciated.</p>