Wednesday 15 July 2015

Unable to attach file in android -


I want to attach a file to a mail .... This is the thing that i ACTION_SENDTO It works fine when I send mail without an attachment, but when I try to attach a file it gives exception ( android.content.ActivityNotFoundException ) like the following link I have tried:

I tried what he replied, but he did not fix it. Here is my code

  Ury mail = Uri. From Ports ("Mail", Message, Empty); Intention Email Intent = New Intent (Intent.ACTION_SENDTO, Mail); EmailIntent.putExtra (Intent.EXTRA_SUBJECT, sub); EmailIntent.putExtra (Intent.EXTRA_TEXT, mailcontent); EmailIntent.setData (Uri.parse ("File: //" + Environment. GetIntileStories Directory ("+ / AB.JPG")); EmailIntent.setType ("Image / JPG"); StartActivity (emailIntent);    

please use element emailintent = new intent (android.content.Intent ACTION_SEND);
and EmailEntent. Input Extra (Intent.EXTRA_STREAM, uri);

No comments:

Post a Comment