Android : create a text file(accessable from file manager)and insert strings in that

on Saturday, September 27, 2014


i need to create a text file(accessable from file manager)and then insert strings in that,how can i do that? i have below code but i can't access text file from file manager:



private void writeToFile(String data) {
try {
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(openFileOutput(FNAME, Context.MODE_APPEND));
outputStreamWriter.write(data);
outputStreamWriter.close();
}
catch (IOException e) {
Log.e(TAG, "File write failed: " + e.toString());
}

}
}

0 comments:

Post a Comment