I have a dialog where I put a surface that is used for a MediaCodec instance to play a video.
When I load this dialog, the surface appears transparent for a few seconds until the mediacodec is ready and the video plays fine. Since this is a dialog, the surface being transparent shows the activity below instead of, say, a black background.
Since I cannot hold the canvas to paint it black myself because that would block mediacodec from accessing it, how can I fix this?