File read write operations on Android2.2

ajaypal

Member
Sep 14, 2011
1
0
We are using Android2.2. We are developing application which will read from a Textview and then write data entered into a file. We are using below code to perform file I/O operation. We are not getting any comilation error nor any exception but file is not getting opened and data is not being written in file. Please suggest what is the problem or what other code we should use.


<code>

username = userid.getText().toString();
password = pwd.getText().toString();
FileOutputStream fos = openFileOutput("out.txt", Context.MODE_PRIVATE);
fos.write(username.getBytes());
fos.close();

</code>
 
Top