title: Permission Denial accessing picture URI on app restart
body: <p>It wouldn't be android programming without the occasional hair-pulling experience...</p>
  
  <p>Using emulator at the moment...</p>
  
  <p>This evidently is a new feature:</p>
  
  <pre><code>Permission Denial: opening provider com.google.android.apps.photos.contentprovider.impl.MediaContentProvider from ProcessRecord{6ebfe9e 22355:xxx/u0a140} (pid=22355, uid=10140) that is not exported from UID 10068
  </code></pre>
  
  <p>Access to EXTERNAL_STORAGE has been granted in all cases.  </p>
  
  <p>Scenario:</p>
  
  <ol>
  <li>User selects a picture (using ACTION_GET_CONTENT) and activity
  result is good and picture is displayed within my app context.   </li>
  <li>URI to picture is saved in app DB.</li>
  <li>App is restarted.</li>
  <li>Attempt to access <strong><em>same</em></strong> URI and get the above Permission Denial
  exception.</li>
  </ol>
  
  <p>Then tried <code>takePersistableUriPermission</code> on original picture selection activity result and that throws an exception indicating there are no persistable permissions.</p>
  
  <p>EDIT: Ok, I've implemented the accepted answer (but just using OPEN_DOCUMENT) and no longer attempt to project the resultant URI into a media path.  So in an act of repentance, I state again:</p>
  
  <blockquote>
    <p>I will never attempt to translate a URI into a Media Store path.</p>
  </blockquote>
  
  <p>(Even though GET_CONTENT and projecting once worked - OK I can't help myself.)</p>