diff --git a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/modal/HippyModalHostView.java b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/modal/HippyModalHostView.java index 4ee9afc767b..247184ac990 100644 --- a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/modal/HippyModalHostView.java +++ b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/views/modal/HippyModalHostView.java @@ -389,9 +389,10 @@ protected void onSizeChanged(final int w, final int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); if (getContext() instanceof NativeRenderContext) { NativeRender nativeRenderer = NativeRendererManager.getNativeRenderer(getContext()); - if (nativeRenderer != null) { + if (nativeRenderer != null && getChildCount() > 0) { + final int id = getChildAt(0).getId(); final int rootId = ((NativeRenderContext) getContext()).getRootId(); - nativeRenderer.onSizeChanged(rootId, getId(), w, h, false); + nativeRenderer.onSizeChanged(rootId, id, w, h, false); } } }