title: Android : Activate SearchDialog from Action bar
body: <p>I've implemented the action bar found here <a href="https://github.com/johannilsson/android-actionbar" rel="nofollow">https://github.com/johannilsson/android-actionbar</a> and it works beautifully. However, I've added a search button and can't get it to show the search dialog. I followed the Google's search dialog tutorial to set my project up, but the dialog just won't show up. Any help?</p>
  
  <p><strong>Manifest</strong>:</p>
  
  <pre><code>&lt;activity android:name=".HomeActivity" android:label="Intelicase Mobile" android:clearTaskOnLaunch="true"&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;!-- enable the search dialog to send searches to SearchableActivity --&gt;
  
    &lt;meta-data android:name="android.app.default_searchable"
               android:value=".SearchActivity" /&gt;            
  &lt;/activity&gt;  
  
  &lt;activity android:name=".SearchActivity" android:launchMode="singleTop"&gt;
    &lt;intent-filter&gt;
      &lt;action android:name="android.intent.action.SEARCH" /&gt;
    &lt;/intent-filter&gt;
    &lt;meta-data android:name="android.app.searchable"
               android:resource="@xml/searchable"/&gt;
  &lt;/activity&gt;
  
  &lt;meta-data android:name="android.app.default_searchable"
             android:value=".SearchActivity" /&gt;
  
  &lt;!-- this activity enables the search dialog to initiate searches in the SearchableActivity --&gt;
  &lt;activity android:name=".OtherActivity"&gt;
    &lt;meta-data android:name="android.app.default_searchable" 
               android:value=".SearchActivity" /&gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p><strong>Action Bar setup</strong>:</p>
  
  <pre><code>ActionBar actBar = (ActionBar) findViewById(R.id.actionbar);
  actBar.setTitle("Dashboard");
  actBar.setHomeAction(new ActionBar.IntentAction(HomeActivity.this, intent, R.drawable.ic_title_home_default));
  
  intent = new Intent().setClass(this, CaseEvidenceActivity.class);
  actBar.addAction(new ActionBar.IntentAction(this, intent, R.drawable.ic_title_export_default));
  
  intent = new Intent().setClass(this, OtherActivity.class);
  actBar.addAction(new ActionBar.IntentAction(this, intent, R.drawable.ic_title_search_default));
  </code></pre>
  
  <p><strong>OtherActivity</strong>:</p>
  
  <pre><code>public class OtherActivity extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.search);
  
          onSearchRequested();
      }   
  }
  </code></pre>
  
  <p><strong>searchables.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="Intelicase Mobile"
      android:hint="Search Intelicase"  android:searchSuggestAuthority="dictionary"
      android:searchSuggestIntentAction="android.intent.action.VIEW"&gt;
  &lt;/searchable&gt;
  </code></pre>