Code example for ResourceCursorAdapter

Methods: getCursor, notifyDataSetChanged

0
 
        // get the query selection, may be null 
        String selection = mSearchable.getSuggestSelection();
        // inject query, either as selection args or inline 
        String[] selArgs = null;
        if (selection != null) {    // use selection if provided
            selArgs = new String[] { query };
        } else {                    // no selection, use REST pattern 
            uriBuilder.appendPath(query);
        } 
 
        if (limit > 0) {
            uriBuilder.appendQueryParameter("limit", String.valueOf(limit));
        } 
 
        Uri uri = uriBuilder.build();
 
        // finally, make the query 
        return mContext.getContentResolver().query(uri, null, selection, selArgs, null);
    }