title: Android mediaplayer reinitializes on screen rotation
body: <p>I am streaming/playing already downloaded video in the <code>VideoView</code>. When I rotate the screen all the objects are reinitialized so that the video is played from the beginning or if get current position and set the position on screen rotation the video is streamed again. As the video from back end is encrypted,it takes so much time to load it resulting in a very bad user experience.
  The following is what I've os far.</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
      VideoView videoView;
      Context context;
      int stopPosition = 0;
      private static MediaController mediaController;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          context = this;
          videoView = (VideoView) findViewById(R.id.videoView1);
          if (savedInstanceState != null) {
              stopPosition = savedInstanceState.getInt("position");
              Log.d("", "savedInstanceState called" + stopPosition);
          }
          mediaController = new MediaController(context);
          mediaController.setAnchorView(videoView);
          String path = "android.resource://" + getPackageName() + "/" + R.raw.videotest;
          Uri uri = Uri.parse(path);
          videoView.setMediaController(mediaController);
          videoView.setVideoURI(uri);
          videoView.requestFocus();
          videoView.start();
      }
  
  
      @Override
      public void onPause() {
          Log.d("", "onPause called");
          super.onPause();
          videoView.pause();
      }
  
      @Override
      protected void onResume() {
          super.onResume();
          Log.d("", "onResume called" + stopPosition);
          videoView.seekTo(stopPosition);
          videoView.resume();
      }
  
      @Override
      public void onSaveInstanceState(Bundle outState) {
          super.onSaveInstanceState(outState);
          videoView.pause();
          outState.putInt("position", 100);
      }
  
      @Override
      protected void onRestoreInstanceState(Bundle savedInstanceState) {
          super.onRestoreInstanceState(savedInstanceState);
          stopPosition = savedInstanceState.getInt("position");
      }
  
  
  }
  </code></pre>
  
  <p>When I used the following methods this problem is solved but some new one starts. </p>
  
  <p>If I add <code>android:configChanges="screenSize|orientation"</code> to <code>AndroidManifest.xml</code> it works perfectly except <code>onSaveInstanceState</code> is not called. I've some works to do in it so I want it be called.
  Another method I used is that using <code>Mediaplayer</code> and <code>SurfaceView</code> and it works too except the <code>mediaplayer</code> not functioned correctly in some cases(Video size changes in each videos)  </p>
  
  <p>Basically what I would like to have is that in above code <code>onRestoreInstanceState</code> should be called and video shouldn't reinitialized(or play without a delay) in screen rotation  </p>