検索可能な辞書に基づくカスタム提案に基づいて、検索ウィジェットにカスタム提案を実装しました
私の searchable.xml
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/app_label"
android:hint="@string/search_hint"
android:searchSuggestAuthority="com.worldclock.CitiesProvider"
android:searchSuggestIntentAction="android.intent.action.VIEW"
android:searchSuggestIntentData="content://com.worldclock.CitiesProvider/cities"
android:searchSuggestSelection=" ?">
</searchable>
AndroidManifest.xml
<provider android:name="com.worldclock.CitiesProvider"
android:authorities="com.worldclock.CitiesProvider"
android:searchSuggestIntentAction="android.Intent.action.VIEW"/>
検索が開始されたリストアクティビティがあります。チュートリアルでは、searchSuggestionIntentAction は「android.Intent.action.VIEW」である必要があると述べていますが、検索可能な辞書の場合のように、ユーザーを別のアクティビティに移動させたくありません。私がしたいのは、アクティビティのライフサイクルをたどることなく、提案されたアイテム (ID を知っている) をリストの一番下に追加することだけです。現在、検索ウィジェットからカスタム提案項目を選択するたびに、リスト アクティビティの onCreate メソッドが呼び出されます。リストを更新せずにアダプターにアイテムを追加するだけでよいのでしょうか?
前もって感謝します。