You cannot create a directory off the root. You can only write to your application-local file store (e.g., getFilesDir()) or external storage.
On Sat, Aug 6, 2011 at 7:10 PM, T.J. <[email protected]> wrote: > Hi all! I have this code: > > String databaseDirectory = "/CountDown"; > Log.v("CD", "trying to create directory"); > File dir = new File(databaseDirectory); > if(!dir.exists()){ > try { > if(dir.mkdir()){ > Log.v("CD","directory created"); > }else{ > Log.v("CD", "creation failed"); > } > } catch (Exception e) { > Log.v("CD", "exception thrown"); > } > }else{ > Log.v("CD", "already exists"); > } > > and I get this output: > trying to create directory > creation failed > > so the directory doesn't exist, and I'm not throwing an exception, but > its not letting me create a directory. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 3.1 Programming Books: http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

