Code example for MergeCursor

0
    public Cursor getAllMediaCursor()
    { 
        Cursor cursor1 = getImagesCursor();
        Cursor cursor2 = getVideosCursor();
         
        MergeCursor mergedCursor = new MergeCursor(new Cursor[] {cursor1, cursor2});
        return mergedCursor;
    } 
     
     
    public ArrayList<MediaVO> getMediaImageList()
    { 
        final ArrayList<MediaVO> resultList = new ArrayList<MediaVO>();
        boolean extStorgAvailable = FileUtils.isExtStorgAvailable();
 
        Uri imageURI = extStorgAvailable ? Images.Media.EXTERNAL_CONTENT_URI : Images.Media.INTERNAL_CONTENT_URI;
        addMedia(resultList, imageURI);
 
        return resultList;