android - How to play a video after the start of the app -


how can play video before app starts?

i made animation shows name , name of app , want have video intro.

try videoview. please check sample code

package com.dwivedi.splashscreenexample;  import android.app.activity; import android.content.intent; import android.media.mediaplayer; import android.media.mediaplayer.oncompletionlistener; import android.net.uri; import android.os.bundle; import android.widget.videoview;  public class mainactivity extends activity {          @override         public void oncreate(bundle savedinstancestate) {                 super.oncreate(savedinstancestate);                 setcontentview(r.layout.activity_main);                 try {                         videoview videoholder = (videoview)this.findviewbyid(r.id.videoview1);                         uri video = uri.parse("android.resource://" + getpackagename()                                         + "/" + r.raw.splash);                         videoholder.setvideouri(video);                          videoholder.setoncompletionlistener(new oncompletionlistener() {                                  public void oncompletion(mediaplayer mp) {                                         jump();                                 }                          });                         videoholder.start();                 } catch (exception ex) {                         jump();                 }         }          protected void jump() {             intent  intent = new intent(this, homeactivity.class);            startactivity(intent);         } } 

Comments