What's the difference between android.app.default_searchable and android.app.searchable meta-data?

StackOverflow https://stackoverflow.com/questions/19232511

  •  30-06-2022
  •  | 
  •  

Вопрос

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.

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top