title: Android video plays but VideoView does not appear
body: <p>I'm attempting to play a video on top of a Google map when the user changes location.  Initially in the activity_main.xml the videoview is set to invisible. When the video is about to play I set the videoview be visible and setZOrderOnTop(true).</p>
  
  <p>When the video is triggered by onLocationChanged the videoview does not appear.  But I can hear the audio from the video so I know its playing.</p>
  
  <p>However if I play a video first in the onCreate, that plays successfully, appearing on screen.  And the onLocationChanged video also plays and appear on screen.</p>
  
  <p>Why does the videovideo view not appear if I don't play a video in the onCreate?</p>
  
  <p><strong>activtity_main.xml</strong></p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent" 
  android:layout_height="fill_parent"
  android:gravity="center" &gt;
  
  &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" &gt;
  
      &lt;TextView android:id="@+id/top_message"
          android:layout_width="fill_parent" android:layout_height="wrap_content"
          android:gravity="center_horizontal"
          android:minWidth="110sp" android:textColor="#66CCFF"
          android:textStyle="bold" android:textSize="20sp" android:text="Default Text" /&gt;
  
      &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/map"
          android:layout_below="@id/top_message"
          android:name="com.google.android.gms.maps.SupportMapFragment"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:gravity="center_horizontal" /&gt; 
  
  &lt;/RelativeLayout&gt;
  
  &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" &gt;
  
      &lt;VideoView 
          android:visibility="invisible"
          android:layout_height="fill_parent"
          android:layout_width="fill_parent"
          android:id="@+id/myVideo"
          android:gravity="center"
          android:layout_centerInParent="true" /&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>public class MainActivity extends FragmentActivity implements LocationListener {
  
  private GoogleMap googleMap;
  private TextView distanceTextView;
  private VideoView videoView;
  private LocationManager locationManager;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.activity_main);        
  
      // setup overlay for text
      distanceTextView = (TextView)findViewById(R.id.top_message);
      distanceTextView.setText("Text set onCreate");
  
      // setup overlay for video
      videoView = (VideoView) findViewById(R.id.myVideo);
  
      // setup google map data
      googleMap = ((SupportMapFragment)(getSupportFragmentManager().findFragmentById(R.id.map))).getMap();
      googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
      googleMap.getUiSettings().setCompassEnabled(true);
      googleMap.getUiSettings().setZoomControlsEnabled(true);
      googleMap.setMyLocationEnabled(true);
  
      locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
      locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 1, this);
      Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
  
      // set current location and move map to that location
      if (location != null) {
          LatLng myPosition = new LatLng(location.getLatitude(),location.getLongitude());
          googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myPosition, 15));
      }
  
      // if below is uncommented then secondvideo will also appear 
      //playVideo(new String("android.resource://" + getPackageName() + "/" + R.raw.firstvideo));
  
  }
  
  public void onLocationChanged(Location location) {
      locationManager.removeUpdates(this);
      distanceTextView.setText("Location has changed");
      playVideo(new String("android.resource://" + getPackageName() + "/" + R.raw.secondvideo));          
  }
  
  private void playVideo(String videoFile) {
      videoView.setVisibility(View.VISIBLE);
      videoView.setZOrderOnTop(true);
  
      MediaController mediaController = new MediaController(this);
      mediaController.setAnchorView(videoView);
      videoView.setMediaController(mediaController);
      videoView.setVideoPath(videoFile);
      videoView.start();
      videoView.setOnTouchListener(new View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              videoView.setVisibility(View.INVISIBLE);
              videoView.setZOrderOnTop(false);
              videoView.stopPlayback();
              return false;
          }
      });
  }
  
  @Override
  public void onProviderDisabled(String arg0) {
      // TODO Auto-generated method stub
  }
  
  @Override
  public void onProviderEnabled(String arg0) {
      // TODO Auto-generated method stub
  }
  
  @Override
  public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
      // TODO Auto-generated method stub
  
  }
  
  }
  </code></pre>