I am not succeeding in creating a new folder on the SD card using the
following code:
try{
String dirName = "/sdcard/testdir";
File newFile = new File(dirName);
newFile.mkdirs();
if(newFile.exists()){
toastLong("directory exists");
if(newFile.isDirectory()){
toastLong("isDirectory = true");
} else toastLong("isDirectory = false");
} else {
toastLong("directory doesn't exist");
}
} catch(Exception e){
toastLong("Exception creating folder " + e);
}
I don't get an exception but the message I do get is "directory
doesn't exist"and in fact the folder is not created. Why doesn't this
work and what is the right way to do this?
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en