title: Android - how to set a thumbnail on a VideoView with a uri source?
body: <p>I need to get an image from a uri into my VideoView when it loads. It should disappear and start playing the video when play is hit. This is my VideoView code -</p>
  
  <pre><code>&lt;RelativeLayout
      android:id="@+id/video_frame"
      android:layout_width="fill_parent"
      android:layout_height="300dp"
      android:background="#000"
      &gt;
  
      &lt;VideoView
          android:id="@+id/video"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_centerInParent="true"
          /&gt;
  
      &lt;ImageButton
          android:id="@+id/play_button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerInParent="true"
          android:src="@drawable/ic_media_play"
          /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>This is how I use it -</p>
  
  <pre><code>final VideoView video = (VideoView) convertView.findViewById(R.id.video);
  
      Uri uri = Uri.parse(submission.getUrl());
      video.setVideoURI(uri);
  
      final ImageButton playButton = (ImageButton) convertView.findViewById(R.id.play_button);
      video.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
          @Override
          public void onCompletion(MediaPlayer mp) {
              playButton.setVisibility(View.VISIBLE);
          }
      });
      playButton.setOnClickListener(new View.OnClickListener() {
  
          public void onClick(View v) {
              if (video.isPlaying()){
              }else{
                  video.start();
                  playButton.setVisibility(View.GONE);
              }
          }
  
      });
  </code></pre>