diff --git a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/ControllerManager.java b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/ControllerManager.java index 7f42e845def..c30123a171f 100644 --- a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/ControllerManager.java +++ b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/ControllerManager.java @@ -442,8 +442,9 @@ public VirtualNode createVirtualNode(int rootId, int id, int pid, int index, @NonNull String className, @Nullable Map props) { HippyViewController controller = mControllerRegistry.getViewController(className); - if (controller != null) { - return controller.createVirtualNode(rootId, id, pid, index, props); + Renderer renderer = mRendererWeakRef.get(); + if (controller != null && renderer instanceof NativeRender) { + return controller.createVirtualNode(rootId, id, pid, index, props, (NativeRender) renderer); } return null; } diff --git a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/HippyViewController.java b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/HippyViewController.java index be449deac6e..505647035f8 100644 --- a/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/HippyViewController.java +++ b/renderer/native/android/src/main/java/com/tencent/mtt/hippy/uimanager/HippyViewController.java @@ -400,7 +400,7 @@ protected RenderNode createRenderNode(int rootId, int id, @Nullable Map props) { + @Nullable Map props, @NonNull NativeRender nativeRender) { // The host can create customize virtual node in a derived class. return null; }