Why image folder not fetch from sd card?
<p>In My application I have need to fetch all image folder separately  from android sd-card
 say there are 3 folder which have images then I want to fetch these 3 folder and set one image on gridview and rest open onclick action but when I write this code not fetch any image folder I am using this code:-</p>

<pre><code>FileFilter objfilefilter = new FileFilter() {

        @Override
        public boolean accept(File pathname) {

              if(pathname.isDirectory())
              {
                  File[] listOfFiles = pathname.listFiles(); 
                  if (listOfFiles == null) return false; 
                  //For each file in the directory...
                  for (File file : listOfFiles) 
                    {                            
                      if (file.getName().endsWith("." + "jpg")) {
                            String folderName = file.getParent();
                            folderName = folderName.replace(SdfolderName,
                                    "");
                            folderName = folderName.replace("/", "");
                            BitmapFactory.Options options = new BitmapFactory.Options();
                            options.inSampleSize = 8;
                            Bitmap bm = BitmapFactory.decodeFile(
                                    file.getAbsolutePath(), options);
                            //AddObjectToList(bm, folderName,
                                //  file.getParent(), folderName);
                            return true;
                        }
                    } 

              }
              else if (pathname.isFile()) {
                    if (pathname.getName().endsWith("." + "jpg")) {
                        String folderName = pathname.getName();
                        BitmapFactory.Options options = new BitmapFactory.Options();
                        options.inSampleSize = 2;
                        Bitmap bm = BitmapFactory.decodeFile(
                                pathname.getAbsolutePath(), options);
                        //AddObjectToList(bm, folderName, pathname.getParent(),
                            //  "");
                        return true;
                    }
                }

            return false;
        }
    };
    File[] imageDirs = extStore.listFiles(objfilefilter);
}
</code></pre>

<p>thanks for advance please help anyone.</p>
