Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
Added in API level 1
public interface

FilenameFilter

java.io.FilenameFilter

Class Overview

An interface for filtering File objects based on their names or the directory they reside in.

Summary

Public Methods
abstract boolean accept ( File dir, String filename)
Indicates if a specific filename matches this filter.

Public Methods

public abstract boolean accept ( File dir, String filename)

Added in API level 1

Indicates if a specific filename matches this filter.

Parameters
dir the directory in which the filename was found.
filename the name of the file in dir to test.
Returns
  • true if the filename matches the filter and can be included in the list, false otherwise.