Android: How do I make a video splash screen repeat until webview finishes loading the url?
Posted
by
Nikoli4
on Stack Overflow
See other posts from Stack Overflow
or by Nikoli4
Published on 2012-05-27T21:06:50Z
Indexed on
2012/06/02
22:40 UTC
Read the original article
Hit count: 272
I would like to make a small video (about 4 seconds) repeat until webview finishes loading the desired URL in the background. Right now the video plays once, then a blank black screen comes up until the page loads. I'm still pretty new to this... Thanks in advance for any help! Sorry for the EDITED stuff, but it was necessary.
Here is my splash java
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Bundle;
import android.widget.VideoView;
public class Splash extends Activity implements OnCompletionListener
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
VideoView video = (VideoView) findViewById(R.id.videoView);
video.setVideoPath("android.resource://com.EDITED/raw/" + R.raw.splash);
video.start();
video.setOnCompletionListener(this);
}
@Override
public void onCompletion(MediaPlayer mp)
{
Intent intent = new Intent(this, EDITEDWebActivity.class);
startActivity(intent);
finish();
}
}
© Stack Overflow or respective owner