Code example for MergeCursor

0
    public Cursor swapCursor(Cursor newCursor) {
        if (originalCursor != newCursor) {
            originalCursor = newCursor;
            if (showPresets) {
                Cursor[] cursors = new Cursor[] {PRESETS_CURSOR, newCursor};
                newCursor = new MergeCursor(cursors);
            } 
            return super.swapCursor(newCursor);
        } 
        return null; 
    } 
 
    @Override 
    public void bindView(View view, Context context, Cursor cursor) {
        SubredditView v = (SubredditView) view;
        String name = cursor.getString(INDEX_NAME);
        v.setData(name, false, -1);
        v.setChosen(singleChoice && Objects.equalsIgnoreCase(selectedSubreddit, name));
    } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE