Code example for FileFilter

Methods: accept

0
			return false; 
		} 
	}; 
 
	private void scanFile(File file) {
		if (mediaFilter.accept(file)) {
			context.sendBroadcast(new Intent(
					Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(file)));
		} 
	} 
 
	public void scan(File file) {
		context.sendBroadcast(new Intent(MEDIA_SCAN_STARTED));
		if (file.isFile()) {
			scanFile(file);
		} else if (file.isDirectory()) {
			scanDir(file);
		} 
		context.sendBroadcast(new Intent(MEDIA_SCAN_FINISHED));
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE