2013-07-04 194 views
2

所以我在我的主要活动中有这行代码。 ortogl.mp4文件是我的SD卡的根文件夹,我有一个索尼爱立信与Android 2.1。 该应用程序安装和控制台说错误1.0,而手机显示布局,但不是视频(它说无法播放该文件)。 提示?视频播放器应用程序

VideoView v = (VideoView) findViewById(R.id.videoView1); 
    v.setVideoPath(getString(R.string._sdcard_ortodgl_3gp)); 
    v.setMediaController(new MediaController(this)); 
    v.start(); 
    v.requestFocus(); 

回答

0

这就是我如何解决它

File clip = new File(Environment.getExternalStorageDirectory(),"ortodgl.mp4"); 

    VideoView v = (VideoView) findViewById(R.id.videoView1); 
    v.setVideoPath(clip.getAbsolutePath()); 
    v.setMediaController(new MediaController(this)); 
    v.start(); 
    v.requestFocus();