I have a situation in Lollipop where I have:
- Directory tree (
DocumentFile
) which is granted from user. A collection of audio files that need to modify retrieved from media provider.
Uri mediaUri = Uri.withAppendedPath(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, "45");
Then, how to write a stream into one of those files?
I think, this https://stackoverflow.com/a/30514269/615025 gives a work around. Copy bytes of the file to cache directory, do modification on the temporary file and then copy the bytes back to the original file.
DocumentFile is a new mechanism which allows us to modify files in Lollipop. It is not the same case with this post how to get contact photo URI Thanks