Skip to content

Remove SlideListener inside a listener will throw ConcurrentModificationException #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
blueberry6401 opened this issue Mar 28, 2016 · 1 comment

Comments

@blueberry6401
Copy link

I have something like

new SlidingUpPanelLayout.SimplePanelSlideListener() {
            @Override
            public void onPanelStateChanged(...) {
                mSlidingLayout.removePanelSlideListener(this);
            }
}

This will throw ConcurrentModificationException.

@charlesdurham
Copy link

Looks like this is because:

private List<PanelSlideListener> mPanelSlideListeners = new ArrayList<>();

Should probably be a CopyOnWriteArrayList http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/CopyOnWriteArrayList.html

atomjack pushed a commit to atomjack/AndroidSlidingUpPanel that referenced this issue Oct 25, 2016
tokudu added a commit that referenced this issue May 17, 2017
Changed mPanelSlideListeners to a CopyOnWriteArrayList. Addresses #695.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants