Search code examples
androidsurfaceviewoverlapping

Support for multiple active overlapping surface views in Android


I am currently working on an Android App that needs several overlapping SurfaceViews in one screen.

To be precise, I have two active overlapping SurfaceViews, one connected to Camera and the other connected to MediaPlayer. It mostly works but is not stable. At times, one of the SurfaceViews does not show up.

I saw a thread from 2009(http://groups.google.com/group/android-developers/browse_thread/thread/08e7df2e96a7973d) that says overlapping SurfaceViews are not supported in Android. Is this still the case? Anyone can share experience on this?


Solution

  • I found it out myself. Call setZOrderOnTop(true) on the SurfaceView I want to have on top seems solve the problem