使我的应用程序能够显示在 Android 全局搜索中
我有一个可搜索的应用程序,我想默认将其包含在 Google 搜索栏中,或者为我的用户提供从我的应用程序中启用它的选项。我已经通过将 android:includeInGlobalSearch
添加到我的 searchable.xml
中来公开它,但如何从应用程序内的设置中启用它?
我知道我还可以启动 Settings.ACTION_SEARCH_SETTINGS
活动并让他们选择它,但是如果它位于初始折叠下方,我将如何将焦点/滚动到我的应用程序?
I have an application that I have made searchable, and I want to include it in the Google Search bar by default, or give my users the option of enabling it from within my application. I have already exposed it by adding android:includeInGlobalSearch
into my searchable.xml
, but how would I enable it from my settings within the application?
I know I can also launch the Settings.ACTION_SEARCH_SETTINGS
activity and have them select it, but how would I shift the focus/scroll to my application if it is below the initial fold?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AFAIK,你不能。用户必须启用它,您不能强迫他们这样做。您也可以控制焦点滚动,最好的办法就是尝试不同的名称,看看这如何影响排序。
AFAIK, you can't. The user has to enable it, you can't force them to. You can' control the focus scroll either, best you could do is experiment with different names and see how this affects sorting.