Getting permission denied when using a URI despite FLAG_GRANT_READ_URI_PERMISSION being set
问题 I have two android apps A and B. I am passing a file from app A to app B and I am seeing that app B is getting the URI. I am setting the FLAG_GRANT_READ_URI_PERMISSION flag in app A and I am seeing that that mFlags is a 1, which is the value of FLAG_GRANT_READ_URI_PERMISSION , from within app B. This is all good, but when I try to create a FileInputStream from the URI, I get a FileNotFoundException (Permission denied) exception. What am I doing wrong? Here are the pertinent code snippets: In