app/src/main/java/com/sap/cloud/mobile/fiori/demo/search/objectcell/SearchSuggestionProvider.java
@Override
    public Cursor query(Uri uri, String[] projection, String selection, @Nullable String[] selectionArgs, String sortOrder) {
        // Use the UriMatcher to see what kind of query we have and format the db query accordingly
        switch (sURIMatcher.match(uri)) {
            case SEARCH_SUGGEST:
                if (selectionArgs == null) {
                throw new IllegalArgumentException("selectionArgs must be provided for the Uri: " + uri);
            }
            return getSuggestions(selectionArgs[0]);
            case SEARCH_ADDRESS:
                if (selectionArgs == null) {
                    throw new IllegalArgumentException("selectionArgs must be provided for the Uri: " + uri);
                }
                return getSuggestions(selectionArgs[0]);
            default:
                throw new UnsupportedOperationException();
        }
    }
/**
     * Handles all the dictionary searches and suggestion queries from the Search Manager.
     * When requesting a specific word, the uri alone is required.
     * When searching all of the dictionary for matches, the selectionArgs argument must carry
     * the search query as the first element.
     * All other arguments are ignored.
     */
Handles all the dictionary searches and suggestion queries from the Search Manager.
When requesting a specific word, the uri alone is required.
When searching all of the dictionary for matches, the selectionArgs argument must carry
the search query as the first element.
All other arguments are ignored.
Handles all the dictionary searches and suggestion queries from the Search Manager . When requesting a specific word the uri alone is required . When searching all of the dictionary for matches the selectionArgs argument must carry the search query as the first element . All other arguments are ignored .
@Override
    public Cursor query(Uri uri, String[] projection, String selection, @Nullable String[] selectionArgs, String sortOrder) {
        switch (sURIMatcher.match(uri)) {
            case SEARCH_SUGGEST:
                if (selectionArgs == null) {
                throw new IllegalArgumentException("selectionArgs must be provided for the Uri: " + uri);
            }
            return getSuggestions(selectionArgs[0]);
            case SEARCH_ADDRESS:
                if (selectionArgs == null) {
                    throw new IllegalArgumentException("selectionArgs must be provided for the Uri: " + uri);
                }
                return getSuggestions(selectionArgs[0]);
            default:
                throw new UnsupportedOperationException();
        }
    }
@ Override public Cursor query ( Uri uri , String [ ] projection , String selection , @ Nullable String [ ] selectionArgs , String sortOrder ) { switch ( sURIMatcher . match ( uri ) ) { case SEARCH_SUGGEST : if ( selectionArgs == null ) { throw new IllegalArgumentException ( "selectionArgs must be provided for the Uri: " + uri ) ; } return getSuggestions ( selectionArgs [ 0 ] ) ; case SEARCH_ADDRESS : if ( selectionArgs == null ) { throw new IllegalArgumentException ( "selectionArgs must be provided for the Uri: " + uri ) ; } return getSuggestions ( selectionArgs [ 0 ] ) ; default : throw new UnsupportedOperationException ( ) ; } }
Handles all the dictionary searches and suggestion queries from the Search Manager.
Handles all the dictionary searches and suggestion queries from the Search Manager .
// Use the UriMatcher to see what kind of query we have and format the db query accordingly