Skip to content Skip to sidebar Skip to footer

How To Access An Image That Is Stored Internally

I have an application that takes a picture and stores the picture internally in a folder that I have created. After taking a picture I want to be able to access it so that I can em

Solution 1:

The code line you forgot is,,

emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(myImage));

In your code, declare File myImage globally in your activity,

Now at Email send code

check whether file is exist or not,

if(myImage.exist())
{
 String emailaddress[] = { "info@sklep.com", "", };
 Intent emailIntent = new Intent(Intent.ACTION_SEND);
 emailIntent.putExtra(Intent.EXTRA_EMAIL, emailaddress);
 emailIntent.setType("image/jpeg");
 emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(myImage));
 startActivity(Intent.createChooser(emailIntent, "Send Mail"));
}

Post a Comment for "How To Access An Image That Is Stored Internally"