title: Android videoview - immersive - overlapping controllers
body: <p>I have a videoview on my app and Im using gogole as a reference to make the video player full screen: </p>
  
  <blockquote>
    <p><a href="https://developer.android.com/training/system-ui/immersive#java" rel="noreferrer">https://developer.android.com/training/system-ui/immersive#java</a></p>
  </blockquote>
  
  <p>I was following the instruccion from the above website and i was able to make the videoplayer full screen but I gt a weird problem with my media controller and the  device controller(they overlp) and don't know how to fixed any ideas what is the problem.</p>
  
  <p><a href="https://i.stack.imgur.com/5vpdp.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/5vpdp.jpg" alt="enter image description here"></a></p>
  
  <pre><code>public class VideoPlayer extends AppCompatActivity {
  
      VideoView videoView;
      MediaController mediaController;
      private String TAG = VideoPlayer.class.getSimpleName();
      @RequiresApi(api = Build.VERSION_CODES.KITKAT)
      @Override
      protected void onCreate(@Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.video_player_activity);
  
          videoView = (VideoView) findViewById(R.id.videoView);
          mediaController = new MediaController(this);
          videoView.setVideoPath("android.resource://" + getPackageName() + "/" + R.raw.video1);
          mediaController.setAnchorView(videoView);
          videoView.setMediaController(mediaController);
          videoView.start(); 
  
      }
  
      @Override
      public void onWindowFocusChanged(boolean hasFocus) {
          super.onWindowFocusChanged(hasFocus);
          if (hasFocus) {
              hideSystemUI();
          }
      }
  
      private void hideSystemUI() { 
          View decorView = getWindow().getDecorView();
          if(Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.KITKAT) {
              decorView.setSystemUiVisibility(
                      View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                              | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                              | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                              | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
                              | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
                              | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
          }
      } 
      private void showSystemUI() {
          Log.e(TAG, "111");
          View decorView = getWindow().getDecorView();
          decorView.setSystemUiVisibility(
                  View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                          | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                          | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
      }
  }
  </code></pre>