title: Android SearchView in actionbar not working
body: <p>First of all sorry if im new to android and java and still want to implement something for my thesis regarding the app im creating, I just want it to have a search view in the action bar for a certain activity to search for the corresponding letters or words in the search for my custom listview... and I dont know what to put in the "doMySearch(String query)" to get the results.</p>
  
  <p><strong>SearchResultsActivity.java</strong></p>
  
  <pre><code>  import android.app.ActionBar;
    import android.app.ListActivity;
    import android.app.SearchManager;
    import android.content.Intent;
    import android.os.Bundle;
    import android.widget.TextView;
  
    public class SearchResultsActivity extends ListActivity {
  
  private TextView txtQuery;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_search_results);
  
      // get the action bar
      ActionBar actionBar = getActionBar();
  
      // Enabling Back navigation on Action Bar icon
      actionBar.setDisplayHomeAsUpEnabled(true);
  
      txtQuery = (TextView) findViewById(R.id.txtQuery);
  
      handleIntent(getIntent());
  }
  
  @Override
  protected void onNewIntent(Intent intent) {
      setIntent(intent);
      handleIntent(intent);
  }
  
  /**
   * Handling intent data
   */
  private void handleIntent(Intent intent) {
      if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
          String query = intent.getStringExtra(SearchManager.QUERY);
  
          doMySearch(query);
          txtQuery.setText("Search Query: " + query);
      }
  }
  
  private void doMySearch(String query) {
      // TODO Auto-generated method stub
         ArrayAdapter&lt;String&gt; adapter =new ArrayAdapter&lt;String&gt;(this, R.layout.subject_list_layout, R.id.subject_course_title_row);
      return adapter;
  
  }
  }
  </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:hint="@string/search_hint"
       android:label="@string/app_name" /&gt;
  </code></pre>
  
  <p><strong>Manifest.xml</strong></p>
  
  <pre><code>        &lt;!-- Sample Search --&gt;
      &lt;activity
          android:name="com.randomlyroaming.com.loaopencourseware.courses.BSIT"
          android:screenOrientation="portrait"
          android:windowSoftInputMode="stateHidden" &gt;
          &lt;meta-data
              android:name="android.app.default_searchable"
              android:value=".SearchResultsActivity" /&gt;
      &lt;/activity&gt;
  
      &lt;!-- Search results activity --&gt;
      &lt;activity
          android:name=".SearchResultsActivity"
          android:label="@string/app_name"
          android:screenOrientation="portrait" &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;
  </code></pre>
  
  <p>Please Help... It is already redirecting to "txtQuery.setText("Search Query: " + query);"
  but no results... Do I need to put something the method "doMySearch(query);" what code can I put it in there for it to work?..</p>
  
  <p>Thank you and Your help is much Appreciated...</p>