zoukankan      html  css  js  c++  java
  • 关于android中搜索功能的实现

    在android应用中,为了有良好的用户体验,需要提供搜索功能,在android中通过系统提供的 SearchManager来进行实现,
    对Search的访问只能通过系统提供的context.getSystemService(Context.SEARCH_SERVICE)来进行实现,不能对SearchManager进行初始化
    需要在res/xml下面添加一个配置文件
    核心为
    <serchable
          xmls:android:"......"
          android:hint="@string/searchHint"
          android:label="@string/searchLable"
          android:searchMode="ShowSearchLabelAsBadge"
          android:searchSuggestAuthority="com.anroid.coding.SearchSuggestionSampleProvider"
          android:searchSuggestSelection="?">
    </serchable>
    <!-- Label 为搜索框上面的文本,hint为搜索框里面的提示文本
    -->
    android:hint="@string/searchHint"
    android:label="@string/searchLabel"
    <!-- 语音搜索配置
     
    android:voiceSearchMode:="showVoiceSearchButton|launchRecognizer"
    android:voiceLanguageModel="free_from"
    android:voicePromptText="@string/search_invoke"
    -->
     
    <!-- 配置搜索建议
    searchSuggesteAuthority的值必须是继承自SearchRecentSuggestionsProvider的完整路径名

    android:searchSuggesterAuthority="com.anroid.coding.SearchSuggestionSampleProvider"
    android:searchSuggestSelection="?"
    -->
     
  • 相关阅读:
    ssm(Spring+Spring mvc+mybatis)Service层实现类——DeptServiceImpl
    JBoss7 安装配置
    JBoss7 安装配置
    在Eclipse/MyEclipse中安装spket插件
    [转载]Node.js是什么
    [转载]Node.js是什么
    iis调度tomcat
    iis调度tomcat
    [转载]Win7 系统安装 配置IIS 详细图解
    在window环境下,设置tomcat自启动服务
  • 原文地址:https://www.cnblogs.com/cwr941012/p/4909983.html
Copyright © 2011-2022 走看看