I am new to android development and I am programming a game. My game has cutsceens that play before each level starts, cutsceens which are done through videoview. My problem
Please try below code it will work absolutely fine
@Override
public void onPause() {
super.onPause();
stopPosition = videoView.getCurrentPosition(); //stopPosition is an int
if (videoView.isPlaying())
videoView.pause();
}
@Override
public void onResume() {
super.onResume();
if (videoView != null) {
videoView.seekTo(stopPosition);
}
}
please make sure below line is mentioned in your Manifest.xml
<activity
android:name="<Video Play Activity Name Here>"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="landscape"
></activity>