Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.57 KB | None | 0 0
  1. В таком случае получаю ошибку
  2. val docUri= DocumentFile.fromTreeUri(BaseApplication.context, Uri.parse(uriPath))
  3.                 if (docUri!=null && docUri.exists()){
  4.                     docUri.createFile(mimeType, fileName)
  5.                 }
  6. Ошибка
  7. Failed to open for writing: java.io.FileNotFoundException: open failed: EISDIR (Is a directory)
  8.  
  9.  
  10.  
  11. А в таком варианте все работает
  12. DocumentFile.fromTreeUri(BaseApplication.context, Uri.parse(uriPath))?.createFile(mimeType, fileName)
  13.  
  14. В чем проблема?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement