title: Android VideoView BringToFront does not work for the second time in Xamarin
body: <p>I am trying to bring a VideoView from the back to the front, but nothing worked. In the following, I will first present the code, then I will present what I attempted, and hopefully someone will be able to solve my problem:</p>
  
  <p>It is a simplified repro for Android app written using Xamarin.</p>
  
  <p>Without further ado, here is my code:</p>
  
  <pre><code>using Android.App;
  using Android.Widget;
  using Android.OS;
  using Android.Media;
  using System;
  
  namespace Experiment
  {
      public class Listener : Java.Lang.Object, MediaPlayer.IOnCompletionListener
      {
          private Action action;
  
          public Listener(Action action)
          {
              this.action = action;
          }
  
          public void OnCompletion(MediaPlayer unused)
          {
              this.action();
          }
      }
  
      [Activity(Label = "Experiment", MainLauncher = true, Icon = "@mipmap/icon")]
      public class MainActivity : Activity
      {
          private VideoView foreView;
          private VideoView backView;
  
          protected override void OnCreate(Bundle savedInstanceState)
          {
              base.OnCreate(savedInstanceState);
  
              // Set our view from the "main" layout resource
              SetContentView(Resource.Layout.Main);
  
              this.foreView = this.FindViewById&lt;VideoView&gt;(Resource.Id.foreView);
              this.backView = this.FindViewById&lt;VideoView&gt;(Resource.Id.backView);
  
              this.foreView.SetVideoURI(Android.Net.Uri.Parse("..."));
              this.foreView.Start();
              this.foreView.SetOnCompletionListener(new Listener(this.OnForeViewCompleted1));
  
              this.backView.SetVideoURI(Android.Net.Uri.Parse("..."));
              this.backView.SetOnCompletionListener(new Listener(this.OnBackViewCompleted1));
          }
  
          private void OnForeViewCompleted1()
          {
              this.backView.Start();
              this.foreView.SetVideoURI(Android.Net.Uri.Parse("..."));
              this.backView.BringToFront();
          }
  
          private void OnBackViewCompleted1()
          {
              this.foreView.SetOnCompletionListener(null);
              this.foreView.Start();
              this.foreView.BringToFront();
  
          }
      }
  }
  </code></pre>
  
  <p>For privacy reason - the actual video URL are replaced with '...', any URL that can serve a mp4 file will work.</p>
  
  <p>And here is the layout associated with the activity</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;VideoView
          android:id="@+id/backView"
          android:layout_width="200px"
          android:layout_height="200px"
          android:layout_marginTop="0px"
          android:layout_marginLeft="0px" /&gt;
      &lt;VideoView
          android:id="@+id/foreView"
          android:layout_width="200px"
          android:layout_height="200px"
          android:layout_marginTop="0px"
          android:layout_marginLeft="50px" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I intended to have the foreView to completely occlude the backView, for this example, however, I deliberately shift the foreView by 50px to the right to show the effect.</p>
  
  <p>The full, runnable Xamarin solution can be found in my <a href="https://github.com/cshung/MiscLab/tree/master/Experiment" rel="nofollow noreferrer">GitHub repository</a></p>
  
  <p>When we run the program, it will first play a video on the foreView, on completion, it will play a video on the backView, on completion, it attempts to bring the foreView up again and play the foreView, but it will not show up to occlude backView, and instead backView occluded the frontView, that something I need to solve.</p>
  
  <p>The above described the problem, here is what I attempted:</p>
  
  <pre><code>foreView.Invalidate() does not work.
  foreView.RequestLayout() does not work.
  foreView.Parent.RequestLayout() does not work.
  </code></pre>
  
  <p>A pull request that fix the problem would be awesome, thanks a lot in advance!</p>