We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b39cb27 commit b38a70cCopy full SHA for b38a70c
1 file changed
debugMenu/src/main/java/com/tapadoo/debugmenu/DebugMenuAttacher.kt
@@ -8,6 +8,7 @@ import androidx.compose.ui.platform.ComposeView
8
import androidx.core.view.ViewCompat
9
import androidx.datastore.core.DataStore
10
import androidx.datastore.preferences.core.Preferences
11
+import androidx.lifecycle.findViewTreeLifecycleOwner
12
import com.tapadoo.debugmenu.module.DebugMenuModule
13
14
/**
@@ -52,6 +53,8 @@ object DebugMenuAttacher {
52
53
enableShake: Boolean = false,
54
) = runCatching {
55
val decor = activity.window?.decorView as? ViewGroup ?: return@runCatching
56
+ if(decor.findViewTreeLifecycleOwner() == null) return@runCatching
57
+
58
// Avoid duplicates
59
val existing = decor.findViewWithTag<FrameLayout>(TAG)
60
if (existing != null) return@runCatching
0 commit comments