I am making an application in which I have to show video from assets folder in a Fragment. Can anyone help me do this? Do I need to use VideoView in XML?
VideoView view = (VideoView)findViewById(R.id.videoView); String path = "android.resource://" + getPackageName() + "/" + R.raw.video_file; view.setVideoURI(Uri.parse(path)); view.start();
It's AkashG's code, but I remember that R here is not from the Android class. It's from your own project.