+
+
\ No newline at end of file
diff --git a/FloatingBubbleView/src/main/java/com/torrydo/floatingbubbleview/bubble/Bubble.kt b/FloatingBubbleView/src/main/java/com/torrydo/floatingbubbleview/bubble/Bubble.kt
index f5ff483..d6a8807 100644
--- a/FloatingBubbleView/src/main/java/com/torrydo/floatingbubbleview/bubble/Bubble.kt
+++ b/FloatingBubbleView/src/main/java/com/torrydo/floatingbubbleview/bubble/Bubble.kt
@@ -71,16 +71,19 @@ open class Bubble(
/**
* - don't call remove if the view did not call show() previously
* - call windowManager.removeViewImmediate() will make the view can't change when added again
+ * - add this line 'if (root.windowToken == null) return' will prevent the view from being removed in some cases
* */
open fun remove() {
- if (root.windowToken == null) return
- windowManager.removeView(root)
+// if (root.windowToken == null) return
+ try {
+ windowManager.removeView(root)
- if (containCompose) {
- composeOwner!!.onPause()
- composeOwner!!.onStop()
- composeOwner!!.onDestroy()
- }
+ if (containCompose) {
+ composeOwner!!.onPause()
+ composeOwner!!.onStop()
+ composeOwner!!.onDestroy()
+ }
+ }catch (_: Exception){}
}
fun update() {