1

I use a SurfaceView for displaying a video in my app, and it is released when I change the content view to somewhere else. My question is quite easy (I guess): When I want to switch back to the view with the video, I have to provide a new SurfaceView to the player, since an error message tells me that the surface has been released.

Can I somehow simply re-initiate the SurfaceView I defined in my layout.xml to reuse it? Or does someone have a better idea to pause a video in a MediaPlayer, display an image, and switch back to the video without destroying the SurfaceView?

Cheers!

  • As workaround, I just added an invisible ImageView, that is made visible, instead of calling setContentView. That consumes probably more memory, but it works. Still, if anyone knows the answer how to reuse a destroyed SurfaceView, I'll like to read it! – user1786963 Nov 01 '12 at 09:29

0 Answers0