Click here to Skip to main content
15,889,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am confused, both parameters, "EXTERNAL_CONTENT_URI" and "INTERNAL_CONTENT_URI", access and display images from "Photos" and "Camera". Shouldn't only the second parameter access them? Furthermore, I did not ask for any permission to read image files from these places and yet I can read and display them in my application. Shouldn't the OS prevent it happening?

Here is the piece of code I am using:
Intent intent = new Intent(Intent.ACTION_PICK,
                android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
                //android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
        intent.setType("image/*");
        startActivityForResult(intent, 0);


What I have tried:

I tried both parameters and I was able to access the same image folders.
Posted
Updated 11-Sep-18 4:49am
v2
Comments
David Crow 11-Sep-18 10:07am    
In some cases, 'internal' and 'external' are not mutually exclusive. For example, the "primary" external storage of your device may be internal if no SD card is present.
tedhill13 11-Sep-18 10:51am    
Then if I understood you correctly, I should only use the "EXTERNAL_CONTENT_URI" parameter because probably images in "Photos" and "Camera" will be always "EXTERNAL" with or without sd card. Am I right ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900