2010-12-20 88 views

回答

0

這裏是 '搜索' 按鈕,該解決方案:

<intent-filter> 
      <action android:name="android.intent.action.SEARCH_LONG_PRESS" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
</intent-filter> 
0

只是爲了存檔:

這(單獨)沒有幫助:

<uses-permission android:name="android.permission.GLOBAL_SEARCH" /> 

<activity android:name=".VoiceActions" 
      android:label="@string/app_name"> 
      <!-- This must be higher than the default priority (0), which 
     is what GoogleSearch uses. --> 
    <intent-filter android:priority="500"> 
     <action android:name="android.search.action.GLOBAL_SEARCH" /> 
     <category android:name="android.intent.category.DEFAULT" /> 
    </intent-filter> 


      <intent-filter> 
      <action android:name="android.intent.action.SEARCH" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 

     <meta-data android:name="android.app.searchable" 
      android:resource="@xml/searchable" /> 

    </activity> 

     <meta-data android:name="android.app.default_searchable" 
     android:value=".VoiceActions" /> 
</application>