0

I've implemented a ContentProvider to add custom suggestions to my applications Quick Search Box. It works great within my app. However I also included it into the global search and it works different there. Whenever I start a search in the global search and I select one of my suggestions, this suggestion is saved and presented the next time I open the global search. What I don't like is that my current suggestions are below the ones I clicked before.

Is there a way to disable this behavior?

I am currently thinking of integrating recent suggestions in my ContentProvider to provide both - recent and custom suggestions. Though I am afraid this will result in having the same suggestions twice - first from the global search and then from my ContentProvider...

Any advice?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

2 Answers2

0

I think you could try to create a custom SearchRecentSuggestionsProvider as described here.

From in there, simply return an empty cursor or null.

Sebastian Roth
  • 11,344
  • 14
  • 61
  • 110
  • interesting idea, but how do I use both - a SearchRecentSuggestionsProvider and [custom suggestion](http://d.android.com/guide/topics/search/adding-custom-suggestions.html). As far as I understand it only one of the two can be used. It is referenced by the 'android:searchSuggestAuthority' – Christian Kirsch Feb 12 '11 at 10:18
  • 1
    In the SearchRecentSuggestionsProvider, you can return a cursor, right? So, try to use a http://developer.android.com/reference/android/database/MergeCursor.html - MergeCursor that contains both the search suggestions and your results. – Sebastian Roth Feb 13 '11 at 07:14
0

To answer my own question, it is possible by providing the SUGGEST_NEVER_MAKE_SHORTCUT value in the SUGGEST_COLUMN_SHORTCUT_ID column.

As usual this is described in the Android developer documentation here.