只是上上手而已的例子。
- package com.chenchen.app;
- import java.io.File;
- import java.io.FilenameFilter;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Random;
- import android.app.Activity;
- import android.content.Context;
- import android.media.MediaPlayer;
- import android.os.Bundle;
- import android.view.KeyEvent;
- import android.view.WindowManager;
- import android.widget.MediaController;
- import android.widget.Toast;
- import android.widget.VideoView;
- public class MainActivity extends Activity {
- private Context context;
- private VideoView videoView;
- /*视频文件分别放在三个文件夹中,需要到时候全部放入一个list中随机播放*/
- private static final String MUSIC_PATH_1 = new String("/sdcard/qingbao/1/");
- private static final String MUSIC_PATH_2 = new String("/sdcard/qingbao/2/");