Code example for FileFilter

Methods: accept

0
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
		File selectedFile = this.files[(int) id];
		if (selectedFile.isDirectory()) {
			this.currentDirectory = selectedFile;
			browseToCurrentDirectory(); 
		} else if (fileSelectFilter == null || fileSelectFilter.accept(selectedFile)) {
            Intent returnIntent = new Intent();
            returnIntent.putExtra("selectedFile", selectedFile
                    .getAbsolutePath());
            returnIntent.putExtra("class", this.viewerClassName);
             
            setResult(RESULT_OK, returnIntent);
			finish();
		} else { 
			showDialog(DIALOG_FILE_INVALID);
		} 
	} 
 
	/** 
	 * Browses to the current directory.