title: Loading an image from assets and displaying in a dialog
body: <p>I have a lot of images in the assets folder of my application that I'd like to display in a <a href="https://i.imgur.com/B7kgT5j.png" rel="nofollow noreferrer">dialog popup</a>. How can I go about doing this? I saw a <a href="https://stackoverflow.com/questions/8533394/icons-in-a-list-dialog?answertab=active#tab-top">similar question</a> covering how to display the icons, with a pretty solid answer. But in the answer, the icons are pulled from a drawable. So, I suppose I have two options:</p>
  
  <p>I have taken a look at the <a href="https://stackoverflow.com/questions/8533394/icons-in-a-list-dialog">"Icons in a list dialog" thread</a> but the answer posted uses drawables. I don't have a drawable for every single image because I have over 250 images. </p>
  
  <p>Then I saw the <a href="https://stackoverflow.com/questions/4884882/is-it-possible-to-load-a-drawable-from-the-assets-folder">"load drawable from assets"</a> thread, but that doesn't quite get me there either. The "icons in a list dialog" expects a specific r.drawable.drawablename. </p>
  
  <p>This is currently how I display the countries text:</p>
  
  <pre><code>public void onClick(Card card, View view) {
       AlertDialog.Builder builder = new AlertDialog.Builder(FtC_Setup.this);
       builder.setTitle("Standard countries");
       final CharSequence[] items = FtC_Play.allCountries.toArray(new CharSequence[FtC_Play.allCountries.size()]);
       builder.setItems(items, null).show(); 
  }
  </code></pre>