I am making a android app in which i am going to use File handling but to do that first i need to create it but by using following code:
File logf = new File("log1.txt"); Boolean bb = logf.exists(); if(!bb) try { bb = logf.createNewFile(); } catch (IOException e) { msg.setText("not able to create file."); } 'msg' is the TextView object which i am using to display error, and when i run this app.. it goes into IOException e catch.. Please tell me if i am doing something wrong or what?.. besides i am using Android 2.2 for my app.