Note that there are some explanatory texts on larger screens.

plurals
  1. POread all image files in gallery on android
    primarykey
    data
    text
    <p>When I read from the following two locations, only some of the photos are read:</p> <pre><code>File appStorage = context.getExternalFilesDir(Environment.DIRECTORY_PICTURES); File externalStorage = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); </code></pre> <p>Downloaded photos for example are not read. Yet, if I manually open the gallery app, I see all my photos in there.</p> <p>So how do I read all images that are in the gallery? Basically, where do I look? </p> <p>EDIT:</p> <p>I really think my question quite obvious, but for some reason people seem to be stuck on <code>ACTION_PICK</code>. I am looking for exactly what I say I am looking for above. If I wanted to use <code>ACTION_PICK</code>, I would use the following code:</p> <pre><code>public void dispatchGalleryIntent(View view) { Intent gallery = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(gallery, LOAD_IMAGE_REQUEST_CODE); } </code></pre> <p>I don't need my user to pick images from the gallery. No. What I need is for the app itself to load all the images that are in the gallery. I am really not sure how else to say this.</p> <p>NOTE:</p> <p>In case more clarification is needed, here is the code I am using to read the files I mention in the OP (i.e., <code>appStorage</code> and <code>externalStorage</code>):</p> <pre><code>void addFiles(final File parent, Set&lt;File&gt; images) { try { for (final File file : parent.listFiles()) { if (!file.isDirectory()) { images.add(file); } else { addFiles(file, images); } } } catch (Exception e) { } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload