Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void writeFile(String fname, String content) {
- File root = android.os.Environment.getExternalStorageDirectory();
- File dir = new File(root.getAbsolutePath());
- dir.mkdirs();
- File file = new File(dir, fname);
- try {
- FileOutputStream f = new FileOutputStream(file);
- PrintWriter pw = new PrintWriter(f);
- pw.println(content);
- pw.flush();
- pw.close();
- f.close();
- } catch (Exception e) {
- e.printStackTrace();
- MyLogs.jasper("" + e.getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement