parent directory of file not writable
I am getting error开发者_开发知识库 like this "
error:parent Directory of a file not writable"
in android.
I've included WRITE_EXTERNAL_STORAGE
permission, but it's not working.
Having that permission doesn't allow you to write anywhere.
You should get the writable path using: Environment.getExternalStorageDirectory();.
Apart from having correct permissions and a writeable path, as was already mentioned by Macarse, you might also want to check if the SDcard mounted is writable (check the Permissions tab in the FileExplorer view it should be something like d---rwxr-x).
If not then remount the SDcard(there are adb commands to do this but are risky, I think). My usual course of action is switching off the phone and removing and then reinserting the SDcard. Sometimes just switching off the phone helps.
I'm getting this error too, only I'm trying to write to internal storage. Any ideas on how to fix the error?
Never mind. I figured it out. Data has to be written to the file streams as bytes if saving to internal storage.
精彩评论