I have this activity that I use to play videos.
public class OtherActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_other);
VideoView view = (VideoView) findViewById(R.id.videoView1);
view.setMediaController(new MediaController(this));
view.setVideoURI(Uri.parse("http:somevideo.mp4"));
}
}
And here is my layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<VideoView
android:id="@+id/videoView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"/>
</RelativeLayout>
Now, the problem here is that whenever I rotate the device the video goes back to the beginning. How can I stop this?