public synchronized void startDetecting(int interval, DifferenceListener l) {
if (detector != null || interval < 0) {
return;
}
Detector detector = new Detector();
detector.setHome(dicHome);
detector.setFilter(null);
detector.setFilter(new FileFilter() {
public boolean accept(File pathname) {
return pathname.getPath().endsWith(".dic.compiled")
|| pathname.getPath().endsWith(".metadata");
}
});
detector.setLastSnapshot(detector.flash());
detector.setListener(l);
detector.setInterval(interval);
detector.start(true);
this.detector = detector;
}