Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File path = new File(Environment.getExternalStorageDirectory(), "Folder");
- if (!path.exists()) {
- path.mkdirs();
- }
- File exportFile = new File(path, fileName);
- FileWriter writer = new FileWriter(exportFile);
- writer.append(body);
- writer.flush();
- writer.close();
- Intent intent = new Intent();
- intent.setAction(Intent.ACTION_SEND);
- intent.setType("text/plain");
- intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(exportFile));
- startActivity(intent);
- File path = new File(this.getFilesDir(), "exports");
- if(!path.exists()){
- path.mkdir();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement