Updated nexus 5 to 4.4.3.
Fileobserver not working for any directory . I tried 1./data/data/com/whatsapp , 2.sdcard/Movies and also 3. "/". Before the update it was working fine.
I saw the RecursiveFileObserver on github and used it along with my fileobserver. When both are used together , then onEvent of my FileObserver is called which is quite wierd. After some time a ANR pops up.
So, how to use fileobserver in android 4.4.3
Here is my code
FileObserver observer = new FileObserver("/data/data/com.whatsapp/databases") {
public void onEvent(int event, String file) {
Log.i("ASH", "path VSLLED");
Log.i("ASH", "path AXCCESSED " + file);
}
};
observer.startWatching();
and the link for the RecursiveFileObserver https://github.com/bartoszprzybylski/owncloud-android/blob/master/src/com/owncloud/android/utils/RecursiveFileObserver.java
Btw, the FileObserver is running on a Service