title: How to get videos in GridView from **SDCard/folder/subfolder"
body: <p>I have to fetch all the videos from <strong>"/SDCard/Folder/SubFolder"</strong> and display them in a GridView.
  I am able to save the videos into the desired subfolder created by me and can see them directly from the folder. But I want to show them into a GridView but when I am running my code, It displays nothing but only a black blank screen. Here is my code, please tell me that what mistake I am doing here.. </p>
  
  <pre><code>    public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.gridview_main);
  
  
          // Check for SD Card
          if (!Environment.getExternalStorageState().equals(
                  Environment.MEDIA_MOUNTED)) {
              Toast.makeText(this, "Error! No SDCARD Found!", Toast.LENGTH_LONG)
                      .show();
          } else {
              // Locate the image folder in your SD Card
              file = new File(Environment.getExternalStorageDirectory()
                      + File.separator + "/SDCard/Picture/MyCameraVideo");
              // Create a new folder if no folder named SDImageTutorial exist
              file.mkdirs();
          }
  
          if (file.isDirectory()) {
              listFile = file.listFiles();
              // Create a String array for FilePathStrings
              FilePathStrings = new String[listFile.length];
              // Create a String array for FileNameStrings
              FileNameStrings = new String[listFile.length];
  
              for (int i = 0; i &lt; listFile.length; i++) {
                  // Get the path of the image file
                  FilePathStrings[i] = listFile[i].getAbsolutePath();
                  // Get the name image file
                  FileNameStrings[i] = listFile[i].getName();
              }
          }
  
          // Locate the GridView in gridview_main.xml
          grid = (GridView) findViewById(R.id.gridview);
          // Pass String arrays to LazyAdapter Class
          adapter = new GridViewAdapter(this, FilePathStrings, FileNameStrings);
          // Set the LazyAdapter to the GridView
          grid.setAdapter(adapter);
  
          // Capture gridview item click
          grid.setOnItemClickListener(new OnItemClickListener() {
  
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                      int position, long id) {
  
                  Intent i = new Intent(ViewActivity.this, ViewImage.class);
                  i.putExtra("filepath", FilePathStrings);
                  i.putExtra("filename", FileNameStrings);
                  i.putExtra("position", position);
                  startActivity(i);
              }
  
          });
      }
  
  }
  </code></pre>