title: get images from gallery only
body: <p>I need to get the uri/paths of all the images taken by the camera (gallery). How can I modify the code below to give me only the images from the gallery. The code below gives me images from other folders too.</p>
  
  <pre><code>public ArrayList&lt;String&gt; getImages()
      {
          ArrayList&lt;String&gt; paths = new ArrayList&lt;String&gt;();
          final String[] columns = { MediaStore.Images.Media.DATA, MediaStore.Images.Media._ID };
          final String orderBy = MediaStore.Images.Media.DATE_ADDED;
          //Stores all the images from the gallery in Cursor
          Cursor cursor = getContentResolver().query(
                  MediaStore.Images.Media.EXTERNAL_CONTENT_URI, columns, null,
                  null, orderBy);
          //Total number of images
          int count = cursor.getCount();
  
          //Create an array to store path to all the images
          String[] arrPath = new String[count];
  
          for (int i = 0; i &lt; count; i++) {
              cursor.moveToPosition(i);
              int dataColumnIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA);
              //Store the path of the image
              arrPath[i]= cursor.getString(dataColumnIndex);
              paths.add(arrPath[i]);
  
          }
  
          return  paths;
      }
  </code></pre>