title: how to build search for more than one fragment?
body: <p>i am using searchview on main activity, and i have 4 fragments, but i can only use searchview in one fragment, and if i use on more than one fragment, app crash. how can i handle it? or is there any library or block code than can help me creating my search on app? thanks.</p>
  <pre><code>    @Override
      public boolean onCreateOptionsMenu(Menu menu)
      {
          getMenuInflater().inflate(R.menu.search, menu);
          menuItem = menu.findItem(R.id.search_option);
          SearchView searchView = (SearchView) menuItem.getActionView();
          searchView.setOnQueryTextListener(this);
          getMenuInflater().inflate(R.menu.playlist_button, menu);
          menuItemplaylist = menu.findItem(R.id.playlist_btn);
          menuItemplaylist.setVisible(false);
          return super.onCreateOptionsMenu(menu);
      }
  
      @Override
      public boolean onQueryTextSubmit(String query)
      {
          return false;
      }
  
      @Override
      public boolean onQueryTextChange(String newText)
      {
          String userInput = newText.toLowerCase();
          ArrayList&lt;Tracks&gt; myFiles = new ArrayList&lt;&gt;();
          for (Tracks song : audios)
          {
              if (song.getSongTitle().toLowerCase().contains(userInput))
              {
                  myFiles.add(song);
              }
          }
          TracksFragment.tracksAdapter.updateList(myFiles);
          return true;
      }
  </code></pre>