Note that there are some explanatory texts on larger screens.

plurals
  1. POACTION_GET_CONTENT on Kindle Fire HD for images returns data with file scheme instead of content scheme
    text
    copied!<p>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.</p> <p>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.</p> <p>Here is the code to fire image selection intent.</p> <p><code>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);</code></p> <p>On 1st Gen Fire this works fine and returns: <strong>content:///mnt/sdcard/Download/naturewallpapers252862529.jpg</strong></p> <p>But on Fire HD-7, it returns: <strong>file:///mnt/sdcard/Android/data/com.amazon.photos/files/Pictures/Shared/naturewallpapers252862529 (7).jpg</strong></p> <p>And here's the most irritating fact:</p> <p>CASE 1) On HD-7, if I select image from gallery, it creates a copy of the selected at "<strong>/mnt/sdcard/Android/data/com.amazon.photos/files/Pictures/Shared/</strong>" 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.</p> <p>CASE 2) On HD-7, if I select image from <strong>ES File Explorer</strong> then everything works fine. It returns <strong>content:///mnt/sdcard/Download/naturewallpapers252862529.jpg</strong> uri with content:// scheme as against file:// in selected from gallery.</p> <p>I am really out of any clues to get this resolved. Struggling since more than a week now.</p> <p>Any help, any clues are highly appreciated. Thanks, Yogesh.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload