I\'m currently developing the android application ServeStream and I\'ve encountered and problem that I can\'t fix. My application will stream music and video using the android M
You can do: mMediaPlayer.setDisplay(null) when surfaceDestroy and when you enter video again setDisplay for mediaPlayer with new surfaceHolder.
Remember, always put this code below inside onStart, because when home pressed or lockscreen, it will force `sufaceCreate' fired with new holder. View will be recreated, video will show instead black screen
holder = mPreview.getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
Hope this help!!