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
I think I know the cause of the problem. It seems that mediaplayer initializes its surface ONLY when you call prepare/Async(). If you will change the surface after that, you will get what you`ve got. So the solution would be to disable standard lifecycle of activity via android:configChanges="orientation|keyboardHidden". This will prevent your activity from recreations. Otherwise you should call for prepare each time you recreate holder.