I hate it when I find the answer two minutes after posting the
question!   All I needed was this:

<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

in the manifest.

On May 6, 4:50 pm, DonFrench <dcfre...@gmail.com> wrote:
> 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 
> athttp://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-beginners?hl=en

-- 
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
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to