1

I have the following searchable xml:

<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="Search"
android:hint="Search"
android:includeInGlobalSearch="true"
android:queryAfterZeroResults="true"
android:voiceSearchMode="showVoiceSearchButton|launchRecognizer"
android:searchSuggestAuthority="com.example.providers.PhotoSearchSuggestionProvider"
android:searchSettingsDescription="Search"
android:searchSuggestSelection=" ?"
android:searchSuggestIntentAction="com.example.providers.PhotoSearchSuggestionProvider.SEARCH_SUGGESTION_CLICKED"
android:searchSuggestIntentData="content://com.example.providers.PhotoSearchSuggestionProvider/suggestions" >

I have the provider class:

public class PhotoSearchSuggestionProvider extends SearchRecentSuggestionsProvider {

public static final String SEARCH_SUGGESTION_CLICKED = "com.example.providers.PhotoSearchSuggestionProvider.SEARCH_SUGGESTION_CLICKED";

public static String AUTHORITY = "com.example.providers.PhotoSearchSuggestionProviderr";

public static int MODE = DATABASE_MODE_QUERIES;

public PhotoSearchSuggestionProvider() {
    super();
    setupSuggestions(AUTHORITY, MODE);
}

}

In my Activity I can see the intent:

@Override
protected void onNewIntent(Intent intent) {
    if(PhotoSearchSuggestionProvider.SEARCH_SUGGESTION_CLICKED.equals(intent.getAction())) {
        //?????
    }
}

Question is, how to get the suggestion data without customizing my suggestionprovider? Can't I just get the data without reading from a database again? Can the Intent somehow contain the data?

Thanks

breakline
  • 5,776
  • 8
  • 45
  • 84

0 Answers0