I am using local database ROOM to store some uri from phone but I can’t reload it in the second times.
The exception is:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.andiogame, PID: 2878
java.lang.SecurityException: com.example.andiogame has no access to content://media/external/images/media/24
at android.os.Parcel.createExceptionOrNull(Parcel.java:2385)
The code is:
Uri uri = Uri.parse(simpleMessage.getUri());
imageView.setImageURI(uri);
2
Answers
Try this
Did you declare permission to read external storage.
Also, if you’re targeting Android 23+ (which you probably are), you need to ask for permissions at runtime.