MediaPlayer


Multithreading Public

Hard  

3min


Which statements are correct for the following code in Splash Activity if the wave file sound is 3 seconds long?

    MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.sound);
    Thread timer = new Thread() {
        @Override
        public void run() {
            try {
                sleep(1000);
                Intent main = new Intent(Splash.this, MainActivity.class);
                startActivity(main);
                finish();
            } catch (InterruptedException e) {}
        }
    };
    timer.start();
    mp.start();