79431109

Date: 2025-02-11 19:19:32
Score: 1
Natty:
Report link

Ok so I found out what I was doing wrong, there were two main things that I was doing wrong. The first thing is that when I got the directory uri with Intent.ACTION_OPEN_DOCUMENT_TREE I didn't get persistable uri permission, which I now do using Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION and contentResolver.takePersistableUriPermission(uri, takeFlags) the other part that I was doing wrong was the method of getting the outputStream as I needed to use a contentResolver for it val out = contentResolver.openOutputStream(newFile.uri) with these changes everything works as I intended!

Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Para1life