I\'m playing video (on VideoView) on portrait mode (not on full screen) and when I change to
landscape mode the video stop.
When I change it to
Unless you specify otherwise, a configuration change (such as a change in screen orientation, language, input devices, etc) will cause your current activity to be destroyed, going through the normal activity lifecycle process of onPause(), onStop(), and onDestroy() as appropriate. If the activity had been in the foreground or visible to the user, once onDestroy() is called in that instance then a new instance of the activity will be created, with whatever savedInstanceState the previous instance had generated from onSaveInstanceState(Bundle).
So what happened behind the scenes: currnet VideoView Activity (landscape) is destroyed, a new VideoView Activity (portrait) is created due screenOrientation configuration has been changed, and destoryed immidiately (where you can see the effects on screen), last activity in stack is shown.
Try to handle this methods and check
@Override
protected void onResume() {
mVideoView.resume();
super.onResume();
}
@Override
protected void onPause() {
mVideoView.suspend();
super.onPause();
}
@Override
protected void onDestroy() {
mVideoView.stopPlayback();
super.onDestroy();
}