I've got an Activity with two views set up in a ViewFlipper. One of the views is a layout with a GLSurfaceView and a few other widgets, the other just has a layout with a TextView and a VideoView. When I click on something in the GLSurfaceView, the ViewFlipper swaps so the video can play. In this screenshot, you can see the plain GLSurfaceView rendering a map on the left. On the right is what it looks like after the ViewFlipper has flipped and the video starts playing.
The empty transparent area where the GLSurfaceView shows through is where the video is supposed to be. I can hear it playing through the speaker and the timeline is moving forward, so I know it's playing.
I can post code if you need it, but there's a lot involved so it could get rather complicated.
Any ideas as to what's going on here?
You cannot have two SurfaceViews
in an activity that overlap, and I suspect that includes cases like ViewFlipper
where technically they would not overlap due to visibility changes.
来源:https://stackoverflow.com/questions/3681976/videoview-in-viewflipper-is-transparent-when-video-is-playing