FilenameFilter, searching for folders
<p>I have this class that implements <code>FilenameFilter</code></p>

<pre><code>package Logic;

 import java.io.File;
 import java.io.FilenameFilter;

public class Filter implements FilenameFilter {

 String name; 

 public Filter(String name) {
    this.name = name; 

 }
 @Override
 public boolean accept(File dir, String filename) {
    return name.contains("bluetooth");
 }
}
</code></pre>

<p>I use this class in this method:</p>

<pre><code>public String searchForBluetoothFolder() {

    String folderNameToSearchFor = "bluetooth";
    File root = sdCard; 
    FilenameFilter filter = new Filter(folderNameToSearchFor);  

    String[] bluetoothFolder = root.list(filter);

    for(int i = 0; i &lt; bluetoothFolder.length; i++) {
        Log.i("Bluetooth: ", bluetoothFolder[i]); 
    }


    return "";
}
</code></pre>

<p>Inside the for-loop, the ouput is just <strong>all</strong> of the files in the root directory, not those who have bluetooth as name. What am I doing wrong here? </p>
