FloatingView icon indicating copy to clipboard operation
FloatingView copied to clipboard

【bug】偶尔会崩溃

Open areful opened this issue 3 years ago • 0 comments

组件挺好用。

不过发现有点问题,在动画addUpdateListener()走到onAnimationUpdate()中时,如果Activity已被销毁,则调updateWindowManager()会导致Crash,报not attached to window manager异常。

通过加入以下判断可避免这个问题:

    if (mIsShow && !mIsDetached) {
        updateWindowManager();
    }

其中mIsDetached是自定义的变量,在onDetachedFromWindow()中置为true.

areful avatar Sep 29 '22 07:09 areful