首页上一页 1 下一页尾页 1 条记录 1/1页
com.ming.myapplication; android.media.MediaPlayer; android.os.Environment; android.support.v7.app.AppCompatActivity; android.os.Bundle; android.view.WindowManager; android.widget.MediaController; android.widget.Toast; android.widget.VideoView; java.io.File; MainActivity AppCompatActivity { onCreate(Bundle savedInstanceState) { .(savedInstanceState); setContentView(R.layout.); getWindow().setFlags(WindowManager.LayoutParams., WindowManager.LayoutParams.); VideoView video=(VideoView) findViewById(R.id.); File file=File(Environment.()+); (file.exists()){ video.setVideoPath(file.getAbsolutePath()); }{ Toast.(MainActivity.,,Toast.).show(); } android.widget.MediaController mc=android.widget.MediaController(MainActivity.); video.setMediaController(mc); video.requestFocus(); video.start(); video.setOnCompletionListener(MediaPlayer.OnCompletionListener(){ onCompletion(MediaPlayer pg){ Toast.(MainActivity.,,Toast.).show(); } }); } }