Yup. I suspect it's in mkdirs() also. If there's a file called widgets
on the SD card, your code won't work.
- dave
On Feb 25, 12:47 pm, TreKing treking...@gmail.com wrote:
On Fri, Feb 25, 2011 at 11:17 AM, b_t bartata...@gmail.com wrote:
What is wrong? Should I check something else?
What
widgets was just an example, the folder and file is:
File folder = new File(Environment.getExternalStorageDirectory(),
myAppName + /widgets);
if (!folder.exists()) {
folder.mkdirs();
}
File file = new File(folder, fileName);
On febr. 25, 18:47, TreKing treking...@gmail.com wrote:
On
Does your application have permission to write to the externel SD card?
http://developer.android.com/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group,
since 1.6, IIRC
also, use Environment.getExternalStorageDirectory() instead of
hardwiring the /sdcard path, as the location may change in future
Yeah thanks guys, I forgot to write the WRITE_EXTERNAL_STORAGE
permission, it's all good now.
It's weird because it's the first time I ever
You're absolutely right, myFile.txt was a directory (who knew!?) So
now I'm making one instance of File and calling mkdirs on just /
sdcard/zackcorp/myfiles/, and then I'm making a second instance of
File, this time with that path AND the file name, and just calling
File.createNewFile(), it
this is because file.mkdirs() doesn't understand that the second
argument you provided to the File constructor is a file name rather
than a directory name. i think you might find, and indeed i found,
that /sdcard/zackcorp/myfiles/myFile.txt is actually a directory. the
directory is writable
6 matches
Mail list logo