Code example for MergeCursor

                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();
Connect your IDE to all the code out there  Get Codota for Java