title: NullPointerException-: Attempt to invoke interface method "android.view.View android.view.MenuItem.getActionView()' on a null object reference
body: <p>I am trying to add search bar on Actionbar and found Nullpointer exception on getActionVeiw(). Pleaes help me to short out this problem I have provided the required detail.</p>
  
  <p>My MainActivity extends AppCompatActivity and return error on this line of code</p>
  
  <pre><code>SearchView searchView = (SearchView)menu.findItem(R.id.action_search).getActionView();
  
  searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
  </code></pre>
  
  <p>for above searchview I am importing </p>
  
  <pre><code>import android.support.v7.widget.SearchView;
  </code></pre>
  
  <p>Menu main.xml file</p>
  
  <pre><code>  &lt;item
          android:id="@+id/action_search"
          android:orderInCategory="100"
          android:title="@string/action_search"
          app:showAsAction="always"
          app:actionViewClass="android.support.v7.widget.SearchView" /&gt;
  </code></pre>
  
  <p>Gradle File -</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.1.1'
      compile 'com.android.support:design:23.1.1'
      compile 'com.android.support:support-v4:+'
      compile 'com.android.support:appcompat-v7:+'
      compile 'com.google.android.gms:play-services-appindexing:8.1.0'
  }
  </code></pre>