Skip to content
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

Hold and Release view outOfMemoryexception. #21

Open
anukools opened this issue Feb 16, 2017 · 2 comments
Open

Hold and Release view outOfMemoryexception. #21

anukools opened this issue Feb 16, 2017 · 2 comments

Comments

@anukools
Copy link

anukools commented Feb 16, 2017

Hey, I got several outOfMemoryExcetion in HoldAndReleaseView. Here are the logs.

Fatal Exception: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
at java.lang.Thread.nativeCreate(Thread.java)
at java.lang.Thread.start(Thread.java:1063)
at java.util.Timer$TimerImpl.(Timer.java:192)
at java.util.Timer.(Timer.java:365)
at java.util.Timer.(Timer.java:384)
at java.util.Timer.(Timer.java:391)
at peekandpop.model.HoldAndReleaseView.(SourceFile:25)
at .peekandpop.PeekAndPop.addHoldAndReleaseView(SourceFile:501).

@hjudez
Copy link

hjudez commented May 8, 2017

Same here. Any solution to this? Seems a new thread is created inside Timer every time we call addLongClickView

@hjudez
Copy link

hjudez commented May 8, 2017

Basically don't create a new Timer in the constructor as it is then created for every time my adapter calls onBindViewHolder. And check if it is not null in cancelPendingTimer.

public PeekAndPopOnTouchListener(int position) { this.position = position; longHoldTimer = new Timer(); }

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