这个android代码有什么问题?

时间:2017-05-16 12:17:01

标签: android

../../

1 个答案:

答案 0 :(得分:-1)

试试这段代码

VideoView videoView;
        setContentView(R.layout.video_activity);
        videoView =(VideoView) findViewById(R.id.vidProfile);

        MediaController mediaController= new MediaController(this);
        mediaController.setAnchorView(videoView);
        String uriPath = "android.resource://com.videoexample/"+R.raw.try_it;
        Uri uri= Uri.parse(uriPath);

        videoView.setMediaController(mediaController);
        videoView.setVideoURI(uri);
        videoView.requestFocus();
        videoView.start();
希望它会有所帮助