@Override public void changeCursor(int partitionIndex, Cursor cursor) { if (partitionIndex >= getPartitionCount()) { // There is no partition for this data return; } Partition partition = getPartition(partitionIndex); if (partition instanceof DirectoryPartition) { ((DirectoryPartition)partition).setStatus(DirectoryPartition.STATUS_LOADED); } if (mDisplayPhotos && mPhotoLoader != null && isPhotoSupported(partitionIndex)) { mPhotoLoader.refreshCache(); } super.changeCursor(partitionIndex, cursor); if (isSectionHeaderDisplayEnabled() && partitionIndex == getIndexedPartition()) { updateIndexer(cursor); } // When the cursor changes, cancel any pending asynchronous photo loads. mPhotoLoader.cancelPendingRequests(mFragmentRootView); }