2

I'm developing an Android app which provides a search interface to be used both locally and globally.

In order for the custom interface to appear in the system's Quick Search Box, the user has to explicitly enable it in the Search settings, which can be programmatically launched through the useful android.app.SearchManager.INTENT_ACTION_GLOBAL_SEARCH intent.

The question is: how can I check programmatically if my searchable interface has been enabled by the user?

The only thing getting me "almost there" is the SearchManager class, which provides (among others):

  • getSearchablesInGlobalSearch method:
    returns a list containing searchable information for all searchable activities that have the android:includeInGlobalSearch attribute set in their searchable meta-data, but no information whether the user has enabled them or not.
  • INTENT_ACTION_SEARCH_SETTINGS_CHANGED intent:
    action broadcasted to inform that the search settings have changed in some way; either searchables have been enabled or disabled, or a different web search provider has been chosen, but again, no information on the actual changes.

Extensive Googling on the matter fails, which could mean that either:

  • I'm missing something exceptionally obvious (possible)
  • it has never been attempted before (unlikely)
  • it's simply impossible

Can somebody shed some light on this?

AMIC MING
  • 6,306
  • 6
  • 46
  • 62
Takhion
  • 2,706
  • 24
  • 30

0 Answers0