简体   繁体   English

从android中的文件路径获取内容uri以用于视频

[英]Get content uri from file path in android for video

know the absolute path of a video (say for eg, /sdcard/abcd.mp4).知道视频的绝对路径(例如,/sdcard/abcd.mp4)。 Is there any way to the content URI for this file?有没有办法获得这个文件的内容 URI?

Actually, in my code, I select the image from gallery and trim the video file and save it in the folder but I don't know how to get the content URI实际上,在我的代码中,我从图库中选择图像并修剪视频文件并将其保存在文件夹中,但我不知道如何获取内容 URI

试试这个代码

Uri.fromFile(new File("/sdcard/sample.jpg"));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM