如何在android应用程序上播放简介
只是一个小视频,像一个动画,作为一个标志,只有5-7秒,比应用程序应该出现,只是一个简单的我认为视频播放器没有按钮没有点击如何在android应用程序上播放简介,android,Android,只是一个小视频,像一个动画,作为一个标志,只有5-7秒,比应用程序应该出现,只是一个简单的我认为视频播放器没有按钮没有点击 你能告诉我该怎么做吗?将你的简介视频文件放在res/raw文件夹中,并将splash布局设置为: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_w
你能告诉我该怎么做吗?将你的简介视频文件放在res/raw文件夹中,并将splash布局设置为:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<VideoView
android:id="@+id/video"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:fitsSystemWindows="true" >
</VideoView>
你想什么时候播放视频?当我第一次打开应用程序时,或者每次应用程序打开时?也可以打开视频?就像游戏上的徽标一样
VideoView videoview = (VideoView) findViewById(R.id.video);
videoview.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.intro_splash));
videoview.setMediaController(null);
videoview.start();
videoview.setOnCompletionListener(new OnCompletionListener()
{
@Override
public void onCompletion(MediaPlayer mp)
{
startActivity(new Intent(SplashActivity.this,AbcActivity.class));
finish();
}
});