title: Android ACTION_VIEW Multiple Images
body: <p>I have between one and three photos I'd like my app to display. I won't know until runtime exactly how many photos are downloaded from the Internet. </p>
  
  <p>I can't figure out how to create an Intent to display the photos. Right now I'm caching them on the sdcard under a folder I create by doing something like (sans error checking):</p>
  
  <pre><code>final File externalDirectory = Environment.getExternalStorageDirectory();
  final String folder = externalDirectory.getAbsolutePath() + "/Android/data/" + packageName + "/files/";
  </code></pre>
  
  <p>This was explained in the <a href="http://developer.android.com/guide/topics/data/data-storage.html#ExternalCache" rel="nofollow">Android Developer Reference</a>.</p>
  
  <p>I can get one photo to display by doing the following:</p>
  
  <pre><code>final Uri uri = Uri.fromFile(file);
  final Intent intent = new Intent(Intent.ACTION_VIEW);
  intent.setDataAndType(uri, "image/*");
  Util.startActivity(this, intent);
  </code></pre>
  
  <p>Where <code>file</code> is the file of a saved photo.</p>
  
  <p>If it helps, I could save the images to any location available to my app, however I would prefer to not have the photos show up listed with the user's other personal photos as that may be annoying. </p>
  
  <p>The Image Viewer has a menu option "Slideshow", so it must know about multiple photos. </p>
  
  <p>I could create my own Image Viewer, but that seems like extra work and beyond what I would I reasonably expect. Even if I did this, I would like the user to be able to install a 3rd party Image Viewer and get a better experience with pan, zoom, share, ...</p>
  
  <p>I tried using the directory of the cached photo files to create the Uri, but the Image Viewer shows a black page. If I pass in the file, it shows just that one file and no others. </p>
  
  <p>I know this must be possible because I can see use the Gallery app and show the photos if I manually select the folder. Everytime I research this issue, the comments say it's not possible to show multiple images. </p>
  
  <p>I suspect there's some magic incantation, but what?</p>