diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewWrapper.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewWrapper.java index f1e91a99aa..7defa9ef01 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewWrapper.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewWrapper.java @@ -61,6 +61,16 @@ public class PlatformViewWrapper extends FrameLayout { @NonNull Context context, @NonNull PlatformViewRenderTarget renderTarget) { this(context); this.renderTarget = renderTarget; + + Surface surface = renderTarget.getSurface(); + if (surface != null) { + final Canvas canvas = surface.lockHardwareCanvas(); + try { + canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR); + } finally { + surface.unlockCanvasAndPost(canvas); + } + } } /**