• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Fatal exception permissons

Here's my runtime compile error. any help would be great!

E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-1
Process: com.samsung.multiscreen.msf20.photoshare, PID: 2591
java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=2591, uid=10081 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
 
You need to do two things:-

1. Add the correct permissions to your AndroidManifest.xml

Code:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

2. Write code to ask the user to confirm these permissions at runtime.

There's a complete example of doing this here

https://mobikul.com/getting-read-write-permission-external-storage-android/
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones