title: Search function on recyclerView in fragment
body: <p>I want to a search function on <code>RecyclerView</code> in fragment , i had set the search view icon successfully .   I remain the function for search now.</p>
  
  <p>I take some tutorial ,some use github and some use the variable i can't know it , i still can't understand them.</p>
  
  <p>I just know it looks like i need filter the data , but i have no idea how to do . Just write a filter function on <code>MyAdapter</code> extends <code>RecyclerView</code> ? and how ?</p>
  
  <p>Is anyone can tell me ? any help will be grateful. </p>
  
  <p>It's my fragment create menu:</p>
  
  <pre><code>@Override
      public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
          inflater.inflate(R.menu.search_menu, menu);
  
          SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.search));
          SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE);
          searchView.setOnQueryTextListener(this);
  
          searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName()));
  
  
          super.onCreateOptionsMenu(menu, inflater);
      }
  </code></pre>
  
  <p>I implements the interface to override two function:</p>
  
  <pre><code>public class ActivityListDomesticFragment extends Fragment implements SearchView.OnQueryTextListener{
      @Override
      public boolean onQueryTextSubmit(String query) {
          return false;
      }
  
      @Override
      public boolean onQueryTextChange(String newText) {
         //I just know i have set the filter right here
          return false;
      }
  }
  </code></pre>
  
  <p>It's my <code>RecyclerView</code> class about constructor:</p>
  
  <pre><code>public class MyAdapterForList extends RecyclerView.Adapter&lt;MyAdapterForList.MyViewHolder&gt;{
  
      private Context context;
      private List&lt;ActivityListItem&gt; mDatas;
  
      public MyAdapterForList(Context context, List&lt;ActivityListItem&gt; datas) {
          super();
          this.context = context;
          mDatas = datas;
      }
  </code></pre>