1: <?xml version="1.0" encoding="utf-8"?>   2: <searchable xmlns:android="http://schemas.android.com/apk/res/android"   3:     android:label="@string/search_label"    4:     android:hint="@string/search_hint"   5:     android:searchSettingsDescription="@string/search_settings_description"   6:     android:searchSuggestAuthority="searchprovider"   7:     android:searchSuggestIntentAction="android.intent.action.SEARCH"   8:     android:searchSuggestThreshold="1"   9:     android:includeInGlobalSearch="true"  10:     android:searchSuggestSelection=" ?"  11:     >  12: </searchable>

参数说明: android:searchSuggestAuthorith 此属性的值就是SearchSuggestAuthorith中的AUTHORITH了。 android:searchSuggestIntentAction 此属性定义了当我们选中搜索提示的内容时发生的目的动作。 android:searchSuggestThreshold 此属性定义了至少输入几个字符时才会弹出提示 android:includeInGlobalSearch 是否将内容加入android的全局搜索。true,加入。 android:searchSuggestSelection 定义搜索时参数的占位符 PS:配置参数不止这些,可以自己看看android的参考手册。 3.配置AndroidManifest.xml
   1: <provider android:name=".SearchSuggestionsProvider" android:authorities="searchprovider" />
注意authorities的属性值哦。o(∩_∩)o

更多相关文章

  1. Android(安卓)xml资源文件中@、@android:type、@*、?、@+含义和区
  2. Android(安卓)自定义View(手写签名)
  3. Android(安卓)xml资源文件中@、@android:type、@*、?、@+含义和区
  4. Android(安卓)Makefile中是 如何识别 TARGET_PRODUCT 的
  5. 修改EditText的光标颜色
  6. Android(安卓)layout xml总结
  7. android中自定义播放器的实现
  8. Android(安卓)在xml布局配置文件中给Button按钮添加事件
  9. textview设置文本每行的行间距

随机推荐

  1. mysql语句实现简单的增、删、改、查操作
  2. MySQL表和列的注释总结
  3. Mysql中事务ACID的实现原理详解
  4. mysql查找删除表中重复数据方法总结
  5. 部署MySQL延迟从库的好处小结
  6. Mysql SSH隧道连接使用的基本步骤
  7. SQL Server 完整备份遇到的一个不常见的
  8. mysql-8.0.15-winx64 使用zip包进行安装
  9. MySQL8.x msi版安装教程图文详解
  10. MySQL中的行级锁定示例详解