Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is my searchable activity's Intent.getAction() null?
    text
    copied!<p>I've followed the <a href="http://developer.android.com/reference/android/app/SearchManager.html" rel="noreferrer">SearchManager</a> documentation yet am still having trouble making one of my app's activities searchable. From my activity, the Search dialog appears, I enter a query, hit search, my activity reopens, then I see this in the log:</p> <pre><code>D/SearchDialog( 584): launching Intent { act=android.intent.action.SEARCH flg=0x10000000 cmp=com.clinkybot.geodroid2/.views.Waypoints (has extras) } I/SearchDialog( 584): Starting (as ourselves) #Intent;action=android.intent.action.SEARCH;launchFlags=0x10000000;component=com.clinkybot.geodroid2/.views.Waypoints;S.user_query=sdaf;S.query=sdaf;end I/ActivityManager( 584): Starting activity: Intent { act=android.intent.action.SEARCH flg=0x10000000 cmp=com.clinkybot.geodroid2/.views.Waypoints (has extras) } D/WAYPOINTS( 1018): NI Intent { cmp=com.clinkybot.geodroid2/.views.Waypoints (has extras) } D/WAYPOINTS( 1018): NI null D/WAYPOINTS( 1018): NI false </code></pre> <p>It appears to me that everything is fine up until the last three lines. The "NI" lines are <code>getIntent().toString(), getIntent().getAction()</code>, and <code>getIntent().hasExtra(SearchManager.QUERY)</code> respectively.</p> <p>ActivityManager appears to be starting my activity with the correct action. Then when my activity starts, it contains no action!? What am I doing wrong?</p> <p>The relevant portion of my manifest is:</p> <pre><code>&lt;activity android:name=".views.Waypoints" android:label="Waypoints" android:launchMode="singleTop"&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>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload