title: how to list all pdf files in my android device
body: <p>I found this code about how to get all my Images. </p>
  
  <p><strong>Can someone tell me how can I get only .pdf files in internal storage and external storage?</strong></p>
  
  <pre><code>final String[] columns = { MediaStore.Images.Media.DATA, MediaStore.Images.Media._ID };
      final String orderBy = MediaStore.Images.Media._ID;
      //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);
          Log.i("PATH", arrPath[i]);
      } 
  </code></pre>