use of com.amaze.filemanager.asynchronous.handlers.FileHandler in project AmazeFileManager by TeamAmaze.
the class MainFragment method startFileObserver.
private void startFileObserver() {
switch(openMode) {
case ROOT:
case FILE:
if (customFileObserver != null && !customFileObserver.wasStopped() && customFileObserver.getPath().equals(getCurrentPath())) {
return;
}
File file = new File(CURRENT_PATH);
if (file.isDirectory() && file.canRead()) {
if (customFileObserver != null) {
// already a watcher instantiated, first it should be stopped
customFileObserver.stopWatching();
}
customFileObserver = new CustomFileObserver(CURRENT_PATH, new FileHandler(this, listView, getBoolean(PREFERENCE_SHOW_THUMB)));
customFileObserver.startWatching();
}
break;
default:
break;
}
}
Aggregations