0

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?

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);
Blue Crystal
  • 21
  • 1
  • 5
  • if your target SDK version is >=23 then you need to ask for permissions at run time. Otherwise Android will not ask for permission like old Android does. – NehaK Sep 11 '18 at 07:08
  • @NehaK, My Min Sdk Version is API 16 and the Target Sdk Version is API 27. Do the changes below in the AndroidManifest.xml content are enough for asking permission at runtime or should I also add some code elsewhere ? 'code' 'code' – Blue Crystal Sep 11 '18 at 14:31
  • Refer my code https://stackoverflow.com/questions/52269983/deny-permission-on-splash-screen-but-again-ask-for-allow-permission-prompt-in-an/52270269#52270269 I answered here – NehaK Sep 11 '18 at 16:25

0 Answers0