file:///sdcard exposed beyond app through Intent.getData()

776 views
Skip to first unread message

Preben Palsgaard

unread,
Nov 2, 2018, 8:19:59 AM11/2/18
to MIT App Inventor Forum
I have built an app that picks mp3 files from the SD card using Activity Starter and AndExplorer. The files are used for building playlists.
On Android 5.0 it works fine, but in Android 7.0 I get this message:
file:///sdcard exposed beyond app through Intent.getData()
-and the program stops.

-and I don't even know what the message means.
Could someone please explain it in simple english :-)
Thanks.

SteveJG

unread,
Nov 2, 2018, 8:42:15 AM11/2/18
to MIT App Inventor Forum
Google removed the ability to use   file:/// as a security change with intents (the ActivityStarter is how AI2 uses intents)  File://  is not permitted in an Intent anymore on Android 7+.  If it is used, it will throw FileUriExposedException  You can not use your neat method using Activity starter to capture files on the external sdCard.

You might be able to use Taifun's  File extension.

Regards,
Steve

Preben Palsgaard

unread,
Nov 2, 2018, 9:49:23 AM11/2/18
to MIT App Inventor Forum
Thanks!

Reply all
Reply to author
Forward
0 new messages