2011-12-08 12 views
2

qsbのカスタム提案を実装しようとしています。提案表としてCREATE TABLE IF NOT EXISTS suggestion_table (_id INTEGER PRIMARY KEY AUTOINCREMENT, suggest_text_1 VARCHAR(50),suggest_intent_data INTEGER)を追加しました。 intent.getDataString()の出力はcontent://com.simple.search.SuggestionProvider/testsです。私はここで本当に混乱している。私はそれがsuggest_intent_dataの値を与えると思った。 intentの列suggest_intent_dataのコンテンツを取得するにはどうすればよいですか?クイック検索ボックス:SUGGEST_COLUMN_INTENT_DATAを取得できません

if (Intent.ACTION_VIEW.equals(intent.getAction())) { 
    Log.d(Tag.getTag(this), (intent.getDataString())); 
    }; 

http://developer.android.com/guide/topics/search/adding-custom-suggestions.htmlからご提案テーブルの SUGGEST_COLUMN_INTENT_DATA列内の各提案のためのデータを定義します。

はSUGGEST_COLUMN_INTENT_DATAカラム 含む、次いで、行ごとに一意のデータでそれを移入することにより 候補テーブル内の各目的に必要なすべてのデータ情報を提供します。この 列のデータは、この 列に定義されているとおりに意図にアタッチされます。 getData()または getDataString()を使用して取得できます。

クエリを実行している間、私はテーブルからsuggest_text_1suggest_intent_dataを選択していなかったsearchable.xml

<?xml version="1.0" encoding="utf-8"?> 
<searchable xmlns:android="http://schemas.android.com/apk/res/android" 
    android:hint="@string/search_hint" 
    android:label="@string/app_label" 
    android:searchSuggestAuthority="com.simple.search.SuggestionProvider" 
    android:searchSuggestIntentAction="android.intent.action.VIEW" 
    android:searchSuggestIntentData="content://com.simple.search.SuggestionProvider/tests" //yeah, I thought this was causing the problem too. But after removing this line no change. 
    android:searchSuggestThreshold="1" 
    android:searchSuggestSelection=" ?" 
    /> 

答えて

0

。固定したものを追加する。

関連する問題