Android FileOutputStream
- by zaid
i am attempting to save an image file using "openFileOutput" and then adding that file to my intent with EXTRA_STREAM. but logcat keeps saying that file size is 0, i have the proper permission in my manifest.
FileOutputStream fos = openFileOutput("p001.jpg", Context.MODE_WORLD_READABLE);
File jpg = getFileStreamPath("p001.jpg");
fos.close();
Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("image/jpeg");
share.putExtra(Intent.EXTRA_SUBJECT, "Fail picture");
share.putExtra(Intent.EXTRA_TEXT, "Epic fail!!!");
share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(jpg));
startActivity(Intent.createChooser(share, "Choose share method."));