Video as a Splash Screen instead of Picture

前端 未结 5 1532
天命终不由人
天命终不由人 2020-12-13 15:43

I am doing the Android Programming Tutorial on Splash Screens where you show a picture or text for 5 Seconds than it goes to the Main Application. My Question is..Instead of

5条回答
  •  [愿得一人]
    2020-12-13 16:22

    imgAnim=(VideoView)findViewById(R.id.animimage);
    
    String uriPath = "android.resource://com.petnvet/" + R.drawable.vidio;
    Uri uri = Uri.parse(uriPath);
    imgAnim.setVideoURI(uri);
    imgAnim.requestFocus();
    imgAnim.start();
    //  imgAnim.setVideoPath("android.resource://com.myapplication/" + R.drawable.vidio);
    int SPLASH_DISPLAY_LENGTH = 3000;
    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            Intent mainIntent = new Intent(SplashScreen.this, Login.class);
            startActivity(mainIntent);
            finish();
        }
    }, SPLASH_DISPLAY_LENGTH);
    

提交回复
热议问题