YoutubeVideoSample
YoutubeVideoSample copied to clipboard
Already in the pool!
有时候快速滑动的时候就挂了。是不是recycle是异步的,2次up事件太短,瞎猜的。 不要这个方法可以不。
java.lang.IllegalStateException: Already in the pool! at android.util.Pools$SimplePool.release(Pools.java:112) at android.util.Pools$SynchronizedPool.release(Pools.java:161) at android.view.VelocityTracker.recycle(VelocityTracker.java:85) at com.xxx.xxx.player.DispatchLayout.dispatchTouchEvent(DispatchLayout.java:83)
recycle肯定是要调用的 必须要回收,暂时想到几个解决方案
- 如果动画处于运行状态,则不响应 down 事件,自然不会出现这个问题
- 可以把VelocityTracker的初始化的位置修改,这个之前我好像试过有问题
- 在recycle的时候,设置velocitytracker 为null
手指按下的时候满足if条件,完事往播放器上滑动,mVelocityTracker没有初始化,action_move的时候就空指针了。