Code example for MergeCursor

0
                MoreCloseables.closeQuietly(mOldCallsCursor);
                return new MergeCursor(
                        new Cursor[]{ createNewCallsHeaderCursor(), mNewCallsCursor });
            } 
 
            return new MergeCursor(new Cursor[]{
                    createNewCallsHeaderCursor(), mNewCallsCursor,
                    createOldCallsHeaderCursor(), mOldCallsCursor});
        } finally { 
            // Any cursor still open is now owned, directly or indirectly, by the caller. 
            mNewCallsCursor = null;
            mOldCallsCursor = null;
        } 
    } 
 
    /** 
     * Updates the adapter in the call log fragment to show the new cursor data. 
     */ 
    private void updateAdapterData(Cursor combinedCursor) {
        final Listener listener = mListener.get();
        if (listener != null) {