Code example for CursorAdapter

Methods: getItem

        return false; 
    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);
        public View newView(Context context, Cursor cursor, ViewGroup parent) {
            LayoutInflater inflater = LayoutInflater.from(context);
Connect your IDE to all the code out there  Get Codota for Java