Code example for Cursor

Methods: deactivate

0
 
    protected abstract long getImageId(Cursor cursor);
 
    protected void invalidateCursor() { 
        if (mCursor == null) return;
        mCursor.deactivate();
        mCursorDeactivated = true;
    } 
 
    protected void invalidateCache() { 
        mCache.clear();
    } 
 
    private static final Pattern sPathWithId = Pattern.compile("(.*)/\\d+");
 
    private static String getPathWithoutId(Uri uri) {
        String path = uri.getPath();
        Matcher matcher = sPathWithId.matcher(path);
        return matcher.matches() ? matcher.group(1) : path;
    }