Code example for FileFilter

Methods: accept

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