title: Null Pointer Exception when calling onCreateOptionsMenu()
body: <p>I'm getting the following error, </p>
  
  <pre><code> java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.SearchView.setOnQueryTextListener(android.support.v7.widget.SearchView$OnQueryTextListener)' on a null object reference
  </code></pre>
  
  <p>on this code:</p>
  
  <pre><code> public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  
      inflater.inflate(R.menu.search_menu, menu);
      final MenuItem item = menu.findItem(R.id.search);
  
      final SearchView searchView = (SearchView) MenuItemCompat.getActionView(item);
      searchView.setOnQueryTextListener(this);
  
  }
  </code></pre>
  
  <p>I can't figure out how to fix it - does anyone have any suggestions? I understand what a nullpointer exception is, but I don't understand why searchView is null.</p>