@Override protected void checkPosition() { super.checkPosition(); if (mWindow == null) { throw new StaleDataException("Attempting to access a closed CursorWindow." + "Most probable cause: cursor is deactivated prior to calling this method."); } }
@Override public long getItemId(int position) { //have a weird situation where during a refresh a touch event on the list can cause an //exception. Trying to avoid it by catching the exceptions and returning a default value. try { return super.getItemId(position); } catch (StaleDataException sdEx) { return 0; } catch (IllegalStateException isEx) { return 0; } }
private void throwIfCursorIsClosed() { if (mBulkCursor == null) { throw new StaleDataException("Attempted to access a cursor after it has been closed."); } }