i need to use different mp4 files dynamically in code and this is what i am trying to do :
String video_name = "event_"+subCategoryClicked+currentPage;
String videoFile = "android.resource://"+getPackageName()+"/raw/"+ video_name;
Bitmap thumbnail = ThumbnailUtils.createVideoThumbnail(videoFile,
MediaStore.Images.Thumbnails.MINI_KIND);
System.out.println(thumbnail);
eventInfoImage.setImageBitmap(thumbnail);
i have double checked that there is a file named event_bloodtest1.mp4 in raw folder i suspect that the error is the path to raw folder. Its easier to find it with resource int ID but then i don't know how to get it dynamically
thx in advance=)!