2

I am facing a weird problem. I have a form in my app where user will input some details and then select an image. On pressing Submit, an email intent will be fired which will create an email draft with user's input pasted in mail body and his selected image attached to the email.

I have some code which works for Kindle Fire 1st Gen as well as other Android devices too. But the same does not work on Fire HD-7.

Here is the code to fire image selection intent.

Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); intent.addCategory(Intent.CATEGORY_OPENABLE); startActivityForResult(Intent.createChooser(intent, "Select Media"), SELECT_MEDIA);

On 1st Gen Fire this works fine and returns: content:///mnt/sdcard/Download/naturewallpapers252862529.jpg

But on Fire HD-7, it returns: file:///mnt/sdcard/Android/data/com.amazon.photos/files/Pictures/Shared/naturewallpapers252862529 (7).jpg

And here's the most irritating fact:

CASE 1) On HD-7, if I select image from gallery, it creates a copy of the selected at "/mnt/sdcard/Android/data/com.amazon.photos/files/Pictures/Shared/" and returns this path which does not work with my code to create email intent with attachment. Also, it creates a new copy with (1), (2) and so on for same image every time I select the same image.

CASE 2) On HD-7, if I select image from ES File Explorer then everything works fine. It returns content:///mnt/sdcard/Download/naturewallpapers252862529.jpg uri with content:// scheme as against file:// in selected from gallery.

I am really out of any clues to get this resolved. Struggling since more than a week now.

Any help, any clues are highly appreciated. Thanks, Yogesh.

Yogesh
  • 311
  • 1
  • 10
  • have you had a look at the possible answer here - https://forums.developer.amazon.com/forums/thread.jspa?messageID=2155࡫ – Offbeatmammal Apr 25 '13 at 16:54
  • Did you ever get a response to your problem, or did you manage to work around it? I am facing the same issue since i am trying to upload a file from the gallery but I cannot get the correct filename for the image. Also the response in the support forum didn't do it for me. – Mike T Jul 05 '13 at 09:10

0 Answers0