How to have onSearchRequested not open a web browser.
- by pcm2a
I have a button in my app. When it is pressed I call the onSearchRequested() method. When this is called the stock search box comes up so the user can type some junk in there. When they press "Go" I need the results returned back to my application but instead the stock browser is opened and a google search is performed. How can I tell it to return the results to my application instead.
I've tried these items in my manifest.xml file:
<meta-data android:name="android.app.default_searchable"
android:value=".MainActivity" />
<activity android:name=".MainActivity"
android:launchMode="singleTop"
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
I've also tried to capture the result in my onCreate with this:
Intent intent = getIntent();
if (Intent.ACTION_SEARCH.equals(intent.getAction()))