开发者

How to get the ID of an image/video on sdcard

开发者 https://www.devze.com 2023-03-05 10:26 出处:网络
In my application, I capture a video using the builtin Camera app and save it to the开发者_高级运维 sdcard. Now, I\'m trying to fetch the thumbnail of this image to show it in a GalleryView. However,

In my application, I capture a video using the builtin Camera app and save it to the开发者_高级运维 sdcard. Now, I'm trying to fetch the thumbnail of this image to show it in a GalleryView. However, to fetch the thumbnail, I need to ID of the media file. But I don't know how I can get the contentID (e.g. content://. . . ./23) using just the URI ("file:///sdcard/...").

I tried using a ContentProvider.managedQuery(), but I'm not able to query for a single file.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号