title: android fileObserver onEvent not being called
body: <p>I am trying to  determine when a file is modified. Currently I have a class file observer class that contains</p>
  
  <pre><code>public class fileObserver extends FileObserver {
      public String absolutePath;
      public fileObserver(String path) {
          super(path, FileObserver.ALL_EVENTS);
          absolutePath = path;
      }
  
      @Override
      public void onEvent(int event, String path) {
          if (path == null) {
              return;
          }
          if (event == FileObserver.MODIFY) {
              Log.d("change","changed");
          }
      }
  }
  </code></pre>
  
  <p>and in my main activity I have</p>
  
  <pre><code>fileObserver test = new fileObserver(fullpathnamehere);
  test.startWatching();
  </code></pre>
  
  <p>fullpathnamehere is the file path of the file that I am trying to observe. I checked and the file path is valid. Can anyone tell me what I'm doing wrong?</p>