title: getSearchableInfo returns NULL
body: <p>After trying ALL of the solutions in stackoverflow about this problem, I decided to ask it here.</p>
  
  <p>I'm trying to implement search bar in my Action bar.
  I'm using <strong>AppCompatActivity</strong> and imported <strong>android.support.v7.widget.SearchView</strong>.</p>
  
  <p>For the record, I'm using PageManager and TabLayout if it has any releation.</p>
  
  <p>I get java.lang.NullPointerException error in the following line: </p>
  
  <pre><code>searchView.setSearchableInfo(
                  searchManager.getSearchableInfo(getComponentName()));
  </code></pre>
  
  <p>This is my code:</p>
  
  <p>search bar declration at <strong>menu_main.xml:</strong></p>
  
  <pre><code>&lt;item
          android:id="@+id/searchPlace"
          android:title="@string/search_hint"
          android:actionViewClass="android.support.v7.widget.SearchView"
          android:showAsAction="always"/&gt;
  </code></pre>
  
  <p><strong>searchable.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;searchable xmlns:android="http://schemas.android.com/apk/res/android"
      android:label="@string/app_name"
      android:hint="@string/search_hint" /&gt;
  </code></pre>
  
  <p><strong>AndroidManifest.xml</strong></p>
  
  <pre><code>&lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:supportsRtl="true"
          android:theme="@style/Theme.AppCompat.Light.NoActionBar" &gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
  
              &lt;meta-data
                  android:name="android.app.default_searchable"
                  android:value=".searchResultActivity" /&gt;
  
          &lt;/activity&gt;
          &lt;activity
              android:name=".Settings"
              android:label="@string/title_activity_settings" &gt;
          &lt;/activity&gt;
  
          &lt;activity
              android:name=".searchResultActivity"
              android:label="@string/app_name"
              android:theme="@style/Theme.AppCompat.Light.NoActionBar"&gt;
  
              &lt;!-- to identify this activity as "searchable" --&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.SEARCH" /&gt;
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
  
              &lt;meta-data
                  android:name="android.app.searchable"
                  android:resource="@xml/searchable" /&gt;
          &lt;/activity&gt;
  </code></pre>
  
  <p>Search code in my <strong>MainActivity.java onCreateOptionsMenu:</strong></p>
  
  <pre><code>// Associate searchable configuration with the SearchView
          SearchManager searchManager =
                  (SearchManager) getSystemService(Context.SEARCH_SERVICE);
          SearchView searchView =
                  (SearchView) menu.findItem(R.id.searchPlace).getActionView();
          searchView.setSearchableInfo(
                  searchManager.getSearchableInfo(getComponentName()));
  </code></pre>
  
  <p>Logcat error:</p>
  
  <pre><code>Process: il.co.test.test, PID: 1642
  java.lang.NullPointerException
          at il.co.test.test.MainActivity.onCreateOptionsMenu(MainActivity.java:106)
          at android.app.Activity.onCreatePanelMenu(Activity.java:2538)
          at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:262)
          at android.support.v7.internal.view.WindowCallbackWrapper.onCreatePanelMenu(WindowCallbackWrapper.java:85)
          at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.onCreatePanelMenu(AppCompatDelegateImplBase.java:267)
          at android.support.v7.internal.view.WindowCallbackWrapper.onCreatePanelMenu(WindowCallbackWrapper.java:85)
          at android.support.v7.internal.app.ToolbarActionBar.populateOptionsMenu(ToolbarActionBar.java:448)
          at android.support.v7.internal.app.ToolbarActionBar$1.run(ToolbarActionBar.java:65)
          at android.os.Handler.handleCallback(Handler.java:733)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:136)
          at android.app.ActivityThread.main(ActivityThread.java:5017)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I'm not sure, and I don't know how to check it - but I am pretty sure my <strong>getActionVIew()</strong> returns <strong>NULL</strong>.</p>
  
  <p>UPDATE 2 - FIXED!</p>
  
  <p>After checking some stackoverflow's about getActionView() null problem,
  The 2nd answer at <a href="https://stackoverflow.com/questions/14286768/getactionview-of-my-menuitem-return-null">getActionView() of my MenuItem return null</a> fixed my problem.
  I had to use namespace <strong>app</strong> instaed of <strong>android</strong>.</p>
  
  <p>Really painful!</p>
  
  <p>Hope someone can find my mistake and help me fix it, since I tried many solutions for 6 hours.</p>
  
  <p>Thanks in advance!</p>