public void playvideo()
{
setContentView(R.layout.testvideo);
VideoView video = (VideoView)findViewById(R.id.videoView1);
String videoName = "testvideo" ;
// You build the URI to your video here
StringBuilder uriPathBuilder = new StringBuilder ();
uriPathBuilder.append ("android.resource://");
uriPathBuilder.append (this.getPackageName ());
uriPathBuilder.append (File.separator);
uriPathBuilder.append ("raw");
uriPathBuilder.append (File.separator);
uriPathBuilder.append (videoName);
Uri uri = Uri.parse (uriPathBuilder.toString ());
video.setVideoURI (uri);
video.start ();
}
这是播放测试视频的功能。单击按钮时调用此函数。视频播放完毕后,我想调用另一个函数。