title: Video as splash
body: <p>I want to play a video file from raw folder as splash.But it is not working.Can anyone please help me to sort out this problem.</p>
  
  <p>This is my code</p>
  
  <pre><code>public class SplashActivity extends Activity implements OnCompletionListener{
  
      private MediaController mc;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_splash);
          VideoView vd = (VideoView) findViewById(R.id.VideoView);
          Uri uri = Uri.parse("android.resource://" + getPackageName() + "/"+R.raw.sea);
          //mc = new MediaController(this);
          //vd.setMediaController(mc);
          vd.requestFocus();
          vd.setVideoURI(uri);
          vd.start();
          // vd.setOnCompletionListener(this);
      }
  
      public void onCompletion(MediaPlayer mp) {
          Intent intent = new Intent(this, MainActivity.class);
          startActivity(intent);
          finish();
      }
  </code></pre>
  
  <p>And my layout is: </p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:gravity="center"&gt;
  
    &lt;VideoView android:layout_height="fill_parent"
      android:layout_width="fill_parent"
      android:id="@+id/VideoView"&gt;
    &lt;/VideoView&gt;
  
  &lt; /LinearLayout&gt;
  </code></pre>