i have made a media player and have called setDataSource(), setDisplay() and prepare() methods in onSurfaceCreated() method. Everything works fine when the view is rendered for the first time, if i rotate the screen, display disappears and only audio is availaible.How would I get it working? I have used video view for displaying video. P开发者_开发问答lease help me with this issue.
From your question I can see that you are using a surface view which will re initiate when you rotate your screen. so you must set your screen mode to either landscape or portrait based on your requirement. Else you must figure out some other way other than using surface view.
When you rotate the screen, Activity gets destroyed and a new one is created with a different configuration. If something doesn't work, it means that you should test your application in the landscape mode.
精彩评论