title: How to detach/release surfaceview from android mediaplayer
body: <p>i have a mediaplayer instance running in a background service. In my main activity i have a surfaceview. </p>
  
  <p>When the activity launches and the surfaceview is created i bind to the service and set the display surface of the mediaplayer to the surfaceview from my main activity. I do this with <code>mPlayer.setSurface(sv.getHolder().getSurface());</code> </p>
  
  <p>The video is displayed and everything works fine so far. When my surfaceview is destroyed, in the <code>surfaceDestroyed()</code> callback i try to detach the surfaceview from the mediaplayer by calling <code>mPlayer.setSurface(null);</code>. The problem is that when i do this i get an error from the mediaplayer(error code 1).</p>
  
  <p>So my question is this, after i have set up a MediaPlayer object and i set the surfaceview with <code>mPlayer.setSurface(sv.getHolder().getSurface());</code> is there a way to release or detach that surfaceview without stopping or reinitializing the mediaplayer object?</p>
  
  <p>Thanks in advance.</p>