Why is my searchable activity's Intent.getAction() null?

Posted by originalbryan on Stack Overflow See other posts from Stack Overflow or by originalbryan
Published on 2010-04-25T13:34:28Z Indexed on 2010/04/25 13:43 UTC
Read the original article Hit count: 272

Filed under:
|
|
|

I've followed the SearchManager documentation yet am still having trouble making one of my app's activities searchable. From my activity, the SearchDialog appears, I enter a query, hit search, my activity reopens, then I see this in the log:

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 

It appears to me that everything is fine up until the last three lines. The "NI" lines are getIntent().toString(), getIntent().getAction(), and getIntent().hasExtra(SearchManager.QUERY) respectively.

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?

The relevant portion of my manifest is:

<activity android:name=".views.Waypoints" android:label="Waypoints" android:launchMode="singleTop">
   <intent-filter>
    <action android:name="android.intent.action.SEARCH" />
    <category android:name="android.intent.category.DEFAULT" />
   </intent-filter>
   <meta-data android:name="android.app.searchable"
    android:resource="@xml/searchable" />
  </activity>

© Stack Overflow or respective owner

Related posts about android

Related posts about search