title: Android: Return search query to current activity
body: <p>I followed the steps described on <a href="http://developer.android.com/guide/topics/search/search-dialog.html" rel="noreferrer">http://developer.android.com/guide/topics/search/search-dialog.html</a> to implement a search feature in my notepad application.</p>
  
  <p>My problem is, that when I finish the search a new activity opens capturing my search query. But what I really want, is the query returned to the current activity instead of starting a new one.</p>
  
  <p>Is this possible?</p>
  
  <p>UPDATE:</p>
  
  <p>AndroidManifest.xml</p>
  
  <pre>
  <code>
  &lt;activity android:name=&quot;MyNotepad&quot;
                    android:label=&quot;@string/app_name&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
                  &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
                  &lt;action android:name=&quot;android.intent.action.SEARCH&quot;&gt;&lt;/action&gt;
              &lt;/intent-filter&gt;
              &lt;meta-data android:resource=&quot;@xml/searchable&quot; android:name=&quot;android.app.searchable&quot;&gt;&lt;/meta-data&gt;
          &lt;/activity&gt;&lt;activity android:name=&quot;Preferences&quot; android:label=&quot;Preferences&quot; &gt;
  &lt;/activity&gt;
  </code>
  </pre>
  
  <p>searchable.xml</p>
  
  <pre>
  <code>
  &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;searchable
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:label=&quot;@string/app_name&quot;
    android:hint=&quot;@string/search_hint&quot;&gt;
  &lt;/searchable&gt;
  </code>
  </pre>
  
  <p>JAVA-code</p>
  
  <pre>
  <code>
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main_pad);
      Intent intent = getIntent();
      if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
          String query = intent.getStringExtra(SearchManager.QUERY);
          Toast.makeText(getApplicationContext(), query, Toast.LENGTH_LONG).show();
      }
  }
  </code>
  </pre>
  
  <pre>
  <code>
  @Override
  public boolean onOptionsItemSelected(MenuItem item)
  {
      switch(item.getItemId())
      {
          case R.id.menuItemSearch:
              startSearch("", false, null, false);
      break;
      }
      return true;
  }
  </code>
  </pre>
  
  <p>Even if I use the search-button on the phone it doesn't work. I therefor believe that the problem is in the AndroidManifest.xml</p>