I have an application that lists all videos in MediaStore. (I need both internal storage and external storage).
Basically I have two cursors which query MediaStore.Video.Media.EXTERNAL_CONTENT_URI and MediaStore.Video.Media.INTERNAL_CONTENT_URI.
Then I use a MergeCursor to merge these queries and display in a ListView with a CursorAdapter.
The thing is that sometimes I want to delete one of the videos, but I need the “content Uri” for this operation because I don’t have a way to determine the storage of the selected video.
I have the full file path of the Video and the ID in MediaStore.
How can I get the “content Uri” from the file path/Uri?
Answering my own question 🙂
Found an easy and trivial(!) way to find the storage of the path:**