In my application I have to send a picture as the attached file using social media.Here is my code.
private void getImage()
{
String state = Environment.getExternalStorageState();
Environment.MEDIA_MOUNTED.equals(state);
Intent picMessageIntent = new Intent(android.content.Intent.ACTION_SEND);
picMessageIntent.putExtra(Intent.EXTRA_STREAM,Uri.parse("/mnt/sdcard/DCIM/Camera /mytry.jpg"));
picMessageIntent.setType("image/jpg");
startActivity(picMessageIntent);
}
Any suggestion can do the job.
You just need to make a correction to the fourth line in the function
getImage():