2013-01-06 70 views
2

我試圖將我的應用程序添加到Android中的全局搜索中,以便用戶可以從其主屏幕搜索我的應用程序。我按照教程http://developer.android.com/guide/topics/search/search-dialog.html,但它似乎不工作。當我測試應用程序並轉到您看到所有可搜索應用程序的設置部分時,我的應用程序未顯示出來。下面是我的一些代碼:Android全球搜索

的Mainfest:

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

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

的這門課程是標籤內。

searchable.xml(RES/XML/searchable.xml):

<?xml version="1.0" encoding="utf-8"?> 
<searchable xmlns:android="http://schemas.android.com/apk/res/android" 
    android:includeInGlobalSearch="true" 
    android:voiceSearchMode="showVoiceSearchButton" 
    android:label="Holo Wikipedia Search" 
    android:hint="Search Wikipedia" > 
</searchable> 

請留下commment如果有任何更多的要看到:)

+0

我面對完全一樣的問題... – slott

回答

0

你嘗試使用字符串資源的標籤和提示?

而是硬編碼字符串,嘗試這樣的事情:

android:label="@string/label_string" 
android:hint="@string/hint_string"