title: can a mediaplayer be restarted when the surfaceview is being recreated? (Android)
body: <p>I have an activity (say activity A) which displays video using a mediaplayer, rendered in a surfaceview.<br>
  The use case is to pause the video, start another activity (say activity B), then come back to activity A.<br>
  Activity A is stopped but not destroyed when going to B, which is good.<br>
  The surface view (since not visibile) IS destroyed (as observed from the notification callbacks).<br>
  When coming back to activity A, and restarting the mediaplayer using start(), the media player does play back the audio, but video is not seen. Errors like this one are output on Logcat:  </p>
  
  <pre><code>11-16 18:14:44.532: ERROR/Overlay(8630): Error = Invalid argument from qbuf
  </code></pre>
  
  <p>Unfortunately, using the new instance of <code>SurfaceHolder</code> as provided by <code>surfaceCreated()</code> doesn't help (i.e. provides the same error).  </p>
  
  <p>I have read in various posts a solution would be to reset the <code>mediaplayer</code> and restart it completely, however it is not efficient, as the end user would have to wait for the whole player preparation <code>cycle + seekTo last positio</code>n within the stream.</p>
  
  <p>As shown with the fact the audio plays back, it should be a matter of plumbing between the the video decoder and the new <code>surfaceholder/view</code>.</p>
  
  <p>What should be the best solution (best = fastest) to resume video playback when resuming the activity?</p>