[6.0.0] fix匿名Runnable对象中包含view对象偶现不执行run的情况

This commit is contained in:
renwj
2023-08-15 18:58:35 +08:00
committed by zhongchao
parent c7d898167d
commit eab175972a

View File

@@ -75,7 +75,7 @@ internal class AccessSyntheticUtils {
val ret = when (t) {
is View -> {
lifecycle = t.lifecycleOwner.lifecycle
ViewCompat.isAttachedToWindow(t)
t.parent == null || ViewCompat.isAttachedToWindow(t)
}
is Activity -> {
lifecycle = t.findViewById<View>(android.R.id.content)?.lifecycleOwner?.lifecycle