Code example for CursorAdapter

Methods: getItem

0
        return false; 
    } 
 
    @Override 
    public boolean onSuggestionClick(int position) {
        Cursor c = (Cursor) mSuggestionsAdapter.getItem(position);
        String query = c.getString(c.getColumnIndex(SearchManager.SUGGEST_COLUMN_TEXT_1));
        Toast.makeText(this, "Suggestion clicked: " + query, Toast.LENGTH_LONG).show();
        return true; 
    } 
 
    private class SuggestionsAdapter extends CursorAdapter {
 
        public SuggestionsAdapter(Context context, Cursor c) {
            super(context, c, 0);
        } 
 
        @Override 
        public View newView(Context context, Cursor cursor, ViewGroup parent) {
            LayoutInflater inflater = LayoutInflater.from(context);
            View v = inflater.inflate(android.R.layout.simple_list_item_1, parent, false);