Hello,

I am successful in creating file using openFileOutput(). and can read
the file using openFileInput().
I am able attach file from external storage sdcard while emailing the
same using getExternalStorageDirectory as
sendIntent.putExtra(Intent.EXTRA_STREAM,
Uri.parse("file://"+Environment.getExternalStorageDirectory()+"/
zibra.txt"));

But while trying to attach file from the openOutputFile stored area
using sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+
getFilesDir() + "/zibra.txt"));, resulting emptied file emailing.
My file is stored in "/data/data/com.example/files/zibra.txt".

Could you please point out what is going wrong in it?
Intent sendIntent = new Intent(Intent.ACTION_SEND);
        sendIntent.putExtra(Intent.EXTRA_EMAIL, recipients);
        sendIntent.putExtra(Intent.EXTRA_SUBJECT, "attachment test");
        sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse
                        ("file://"+ getFilesDir() + "/zibra.txt"));
                        
//("file://"+Environment.getExternalStorageDirectory()+"/
zibra.txt"));
        sendIntent.setType("text/plain");
        startActivity(Intent.createChooser(sendIntent, "Send mail..."));

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to