8

I'm pretty new to Android and I need a search widget to get suggestions from my own dictionary. I realized some tutorials use android.app.default_searchable meta-data and others the android.app.searchable. I can't find the difference explained though.

JJD
  • 50,076
  • 60
  • 203
  • 339
Dpedrinha
  • 3,741
  • 3
  • 38
  • 57

1 Answers1

10

The difference is that android.app.default_searchable is used to declare which searchable activity to use for searches, the activity has enabled the search dialog. While the user is in this activity and when the user executes the search, the system starts SearchableActivity and delivers it the ACTION_SEARCH intent.
By instance if you want to show the search dialog and deliver searches to other activity, you must declare in the manifest that activity1 targeted as android.app.searchable is the searchable activity to use for the search dialog in activity2 targeted as android.app.default_searchable.

Jans
  • 11,064
  • 3
  • 37
  • 45
  • Got it. So `default_searchable` is used to tell the Android System which is the default searchable activity, and is not needed for search queries from inside my app, is that right? Thanks! – Dpedrinha Oct 07 '13 at 19:42
  • 3
    The `default_searchable` only tell to the system, that you activity is configured to show the search dialog inside your application and when then the query is delivered to real search action activity, you can see [android explanation](http://developer.android.com/guide/topics/search/search-dialog.html) – Jans Oct 07 '13 at 19:50