禁用Android的全球快速搜索框最近查询建议?快速搜索、最近、建议、全球

2023-09-07 12:43:39 作者:▲百度找不到我对你的爱

我实现ContentProvider的自定义建议添加到我的应用程序快速搜索框。据我的应用程序中的伟大工程。不过,我也包括它变成全局搜索和它的作品不同在那里。每当我开始在全局搜索搜索,我选择我的建议之一,这个建议被保存,presented下一次我打开全局搜索。我不喜欢的是,我目前的建议是低于我之前单击了的。

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?

我目前想在我的ContentProvider整合最近建议,同时提供的 - 最近的和定制的建议。虽然这恐怕会导致具有相同的建议两次 - 第一次从全局搜索,然后从我的ContentProvider ...

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...

任何意见?

推荐答案

要回答我的问题,可以通过提供 SUGGEST_NEVER_MAKE_SHORTCUT 在 SUGGEST_COLUMN_SHORTCUT_ID 列。

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

像往常一样,这是Android开发者文档中描述的这里。

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