2013-10-13 26 views
0

我已啓用/檢查我的應用程序的設置爲QSB。它會在我的活動中的SeachView中正確顯示建議。我添加了android:includeInGlobalSearch =「true」,但仍然沒有看到任何結果。還有什麼我可能已經忘記的東西嗎?QuickSearchBox不顯示我的應用程序的任何搜索結果

這裏是我的searchable.xml:

<?xml version="1.0" encoding="utf-8"?> 
<searchable xmlns:android="http://schemas.android.com/apk/res/android" 
    android:label="@string/app_name" 
    android:hint="@string/search_hint" 
    android:voiceSearchMode="showVoiceSearchButton|launchRecognizer" 
    android:imeOptions="actionSearch" 
    android:searchSuggestAuthority="android.myapp.searchsuggestions" 
    android:searchSuggestIntentAction="android.intent.action.VIEW" 
    android:searchSettingsDescription="@string/settings_description" 
    android:includeInGlobalSearch="true" /> 

編輯:好的,我已經注意到,它是工作在質監局在升級Froyo,但不是在4.2和4.3。很奇怪。有任何想法嗎?

回答

0

我想通了! 在我的清單中的提供者標記中,我設置了exported =「false」 這當然會阻止提供者的數據在我的應用程序之外被看到。所以,我將它設置爲「真實」,現在就可以運行。

<provider android:name=".SearchSuggestionsProvider" android:exported="true" 
     android:authorities="com.example.myapp.searchsuggestions"/> 
+0

不知道爲什麼它在Froyo上工作,即使導出=「false」也許是Froyo中的一個錯誤。 –