I have a pretty simple implementation of FileObserver:
observer = new FileObserver(rootPath+"Pictures") {
@Override
public void onEvent(int event, String path) {
//event &= FileObserver.ALL_EVENTS;
Log.d("home","event: "+event);
if (event == FileObserver.CREATE) {
Toast.makeText(cont, "File created", Toast.LENGTH_SHORT).show();
}
}
};
observer.startWatching();
it's not registering the FileObserver.CREATE constant (256)
. My log is showing several 1's (Access), a few 16's (close_nowrite) and a few 32's (open) when I create a file but never a 256
.
I've tried on two devices (Samsung Galaxy S7 Active and One Plus Two)
anything I need to do differently here?