app/src/main/java/com/sap/cloud/mobile/fiori/demo/search/dictionary/SearchableDictionary.java
private void showResults(String query) {

        Cursor cursor = managedQuery(DictionaryProvider.CONTENT_URI, null, null,
                new String[]{query}, null);

        if (cursor != null) {
            // Specify the columns we want to display in the result
            String[] from = new String[]{DictionaryDatabase.KEY_WORD, DictionaryDatabase.KEY_DEFINITION};

            // Specify the corresponding layout elements where we want the columns to go
            int[] to = new int[]{R.id.word, R.id.definition};

            mListView.setAdapter(new SimpleCursorAdapter(this, R.layout.searchable_dictionary_word, cursor, from, to));
        }
    }
/**
     * Searches the dictionary and displays results for the given query.
     *
     * @param query The search query
     */
Searches the dictionary and displays results for the given query.
@param query The search query
Searches the dictionary and displays results for the given query . @param query The search query
private void showResults(String query) {
        Cursor cursor = managedQuery(DictionaryProvider.CONTENT_URI, null, null,
                new String[]{query}, null);
        if (cursor != null) {
            String[] from = new String[]{DictionaryDatabase.KEY_WORD, DictionaryDatabase.KEY_DEFINITION};
            int[] to = new int[]{R.id.word, R.id.definition};
            mListView.setAdapter(new SimpleCursorAdapter(this, R.layout.searchable_dictionary_word, cursor, from, to));
        }
    }
private void showResults ( String query ) { Cursor cursor = managedQuery ( DictionaryProvider . CONTENT_URI , null , null , new String [ ] { query } , null ) ; if ( cursor != null ) { String [ ] from = new String [ ] { DictionaryDatabase . KEY_WORD , DictionaryDatabase . KEY_DEFINITION } ; int [ ] to = new int [ ] { R . id . word , R . id . definition } ; mListView . setAdapter ( new SimpleCursorAdapter ( this , R . layout . searchable_dictionary_word , cursor , from , to ) ) ; } }
Searches the dictionary and displays results for the given query.
Searches the dictionary and displays results for the given query .
// Specify the columns we want to display in the result // Specify the corresponding layout elements where we want the columns to go