views:

76

answers:

1

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.

Screenshot

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?

+2  A: 

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.

CommonsWare
Thanks, that's the problem. I was able to use setVisible(View.INVISIBLE) on the GLSurfaceView to prevent them from overlapping.
Bob Somers
Can you please describe the moment when you toggle it to invisible using `ViewFlipper`? I have a similar issue with simple `LinearLayout`/`VideoView` pair for flipper and even when I hide first layout using setVisibility(INVISIBLE) before or after `flipper.showNext()`, I don't see the video window, but it plays video for sure in background.
shaman.sir
and yes, here's link to [my question](http://stackoverflow.com/questions/3788497/videoview-plays-ok-but-not-visible-when-swapping-fullscreen-views)
shaman.sir