Code example for CursorAdapter

Methods: getCount

0
 
        protected List<HeaderData> generateHeaderList() {
            Map<Long, HeaderData> mapping = Maps.newHashMap();
            List<HeaderData> headers = Lists.newArrayList();
 
            for (int i = 0; i < getCount(); i++) {
                long headerId = getHeaderId(i);
                HeaderData headerData = mapping.get(headerId);
                if (headerData == null) {
                    headerData = new HeaderData(i);
                    headers.add(headerData);
                } 
                headerData.incrementCount();
                mapping.put(headerId, headerData);
            } 
 
            return headers;
        } 
 
        @Override 
        public Cursor swapCursor(Cursor newCursor) {