title: Xamarin android display image from external Storage
body: <p>I'm currently trying to displa an image from the storage, but I have no success.</p>
  <p>What I'm dooing.</p>
  <pre><code>  public Stream ReadImage(string path) 
      {
  
          //var uri = Android.Net.Uri.Parse(path);
          //var stream = MainActivity._activity.ContentResolver.OpenInputStream(uri);
          //return stream;
          var memoryStream = new MemoryStream();
  
          using (var source = System.IO.File.OpenRead(path))
          {
              source.CopyTo(memoryStream);
          }
  
          return memoryStream;
      }
  </code></pre>
  <p>string path = &quot;/storage/emulated/0/DCIM/Camera/IMG_20190521_094202.jpg&quot;</p>
  <pre><code>     var imageSource = ImageSource.FromStream(
              delegate { 
                  return DependencyService.Get&lt;IMediaHelper&gt;().ReadImage(path);
              });
  </code></pre>
  <p>But in the using line the programm doese not proceed, it does not reach the following lines and it does not load the file from the storage, the way with the contetn resolver does end teh same way, in the contentresolver line.</p>
  <p>I have the Read/write external storage permission.</p>
  <p>I am using android x, with Xamarin 5.0.0.2012. Under android 10 &amp; and 11, on multiple different xiaomi devices.</p>
  <p>This might be a bug, because I think, I had it running in an earlier project.</p>
  <p>Some insight woult be appreciated, I'm biting my teath out on this nut.</p>