自己去写provider
demo中有searchdemo

解决方案 »

  1.   


    谢谢快速回复, 不过provider是用来提suggestions的吧, 我现在不用suggestions只需要调用自定义的search dialog
      

  2.   

    楼主这个问题解决了没啊?刚才我也折腾了好久哦!明明代码就是那样写,按照那些步骤完成的就是调不出来,最后我的挣扎才发现诡异问题出现在searchable.xml:android:label="DiseaseListActivity"
        android:hint="Search Diseases... 这两行代码中,这里的值必须放在String.xml定义。当时我也是跟你一样直接赋值了。后面我把它们放到String.xml再引用就解决了。希望对你有帮助。
      

  3.   

    补充一下:[code=XM]<?xml version="1.0" encoding="utf-8"?>
    <searchable xmlns:android="http://schemas.android.com/apk/res/android"
        android:label="string resource"
        android:hint="string resource"
        android:searchMode=["queryRewriteFromData" | "queryRewriteFromText"]
        android:searchButtonText="string resource"
        android:inputType="inputType"
        android:imeOptions="imeOptions"
        android:searchSuggestAuthority="string"
        android:searchSuggestPath="string"
        android:searchSuggestSelection="string"
        android:searchSuggestIntentAction="string"
        android:searchSuggestIntentData="string"
        android:searchSuggestThreshold="int"
        android:includeInGlobalSearch=["true" | "false"]
        android:searchSettingsDescription="string resource"
        android:queryAfterZeroResults=["true" | "false"]
        android:voiceSearchMode=["showVoiceSearchButton" | "launchWebSearch" | "launchRecognizer"]
        android:voiceLanguageModel=["free-form" | "web_search"]
        android:voicePromptText="string resource"
        android:voiceLanguage="string"
        android:voiceMaxResults="int"
        >
        <actionkey
            android:keycode="KEYCODE"
            android:queryActionMsg="string"
            android:suggestActionMsg="string"
            android:suggestActionMsgColumn="string" >
    </searchable>[/code] 中已经指明 android:label="[color=#FF0000]string resource",android:hint="string resource",android:searchSettingsDescription="string resource" [/color]你可以看官网:http://developer.android.com/guide/topics/search/searchable-config.html