title: Android : Positionning the MediaController with setAnchorView
body: <p>Since 24 hours I'm trying to set the Anchor view of my MediaControler without success.</p>
  
  <p>My VideoView is embedded in a bigger application but even with a very simple testing app I don't understand the problem.</p>
  
  <p>Here is the code of the onCreate of my testing activity : </p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
  
  final VideoView vv = (VideoView) findViewById(R.id.videoView1);
  vv.setVideoURI(Uri.parse("http://192.168.30.188/test.mp4"));
  
  final MediaController mediaController = new MediaController(ll.getContext());
  vv.setMediaController(mediaController);                     
  
  vv.setOnPreparedListener(new OnPreparedListener() {
  
      @Override
      public void onPrepared(MediaPlayer mp) {
          mediaController.setAnchorView(vv);
      }
  });
  
  vv.requestFocus();
  
  }
  </code></pre>
  
  <p>And here is my simple layout :</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity" &gt;
  
  
          &lt;FrameLayout
              android:id="@+id/layout1"
  
              android:layout_width="218dp"
              android:layout_height="162dp"
              android:background="@android:color/holo_purple"&gt;
  
          &lt;VideoView
              android:id="@+id/videoView1"
              android:layout_width="match_parent"
              android:layout_height="match_parent" /&gt;
  
          &lt;/FrameLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>It seems that the media controller appears aligned with the bottom of my video view, but ever horitzontally centered !!!</p>
  
  <p>I had a look at a lot of stack overflow "solutions" (more or less good) or other site samples and I can't understand  ...</p>
  
  <p>Can anybody help me please ?</p>