hi im just trying to save some text to a file on android and while it works fine on the emulator "dont crash", when i try it on my phone it crashes, what am i doing wrong? heres the code:
try{ File root = Environment.getExternalStorageDirectory(); if (root.canWrite()){ File file = new File(root, "file.txt"); FileWriter writer = new FileWriter(file); BufferedWriter out = new BufferedWriter(writer); out.write("some data"); out.close(); showMes("File saved."); }else{ showMes("Could not save file."); } }catch(Exception e){ showMes(e.toString()); } i do know it crashes on " File root = Environment.getExternalStorageDirectory(); " i just dont know why. showMes() is just a function to make toast. thanks for any help. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en