title: FileObserver onCreate Event does not trigger itself in activity
body: <p>I defined FileObserver class outside the activity</p>
  
  <pre><code> public class MyFileObserver extends FileObserver {
      public String absolutePath;
      public MyFileObserver(String path) {
          super(path, FileObserver.ALL_EVENTS);
          absolutePath = path;
      }
      @Override
      public void onEvent(int event, String path) {
        if (path == null) {     
     return;
      }
  
      if ((FileObserver.CREATE &amp; event)!=0) {
          TextView tv = (TextView)findViewById(R.id.text1);
  
      //Set the text
          tv.setText("CREATED!");
      }
  
      }
    } 
  </code></pre>
  
  <p>and created an instance and started watching the file using StartWatching() in main activity</p>
  
  <pre><code> MyFileObserver fileOb = new MyFileObserver("/mnt/sdcard/");
   fileOb.startWatching();
  </code></pre>
  
  <p>when i run the application and copy file in the directory being observed OnEvent() does not gets triggered, but when I click the button (used for other purpose defined in main activity) OnEvent triggers and gives the desired result. My question is that why this OnEvent() function does not trigger itself ? Is it because I am calling startWatching() in mainactivity, if this is the case then where should I call this function. Thanks in advance.  </p>
  
  <p>here is my onCreate() method . </p>
  
  <pre><code> @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      MyFileObserver fileOb = new MyFileObserver("/mnt/sdcard/");
      fileOb.startWatching();
  
      FloatingActionButton fab = (FloatingActionButton)                                       findViewById(R.id.fab);
      fab.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                      .setAction("Action", null).show();
  
  
          }
      });
  
  
  }
  </code></pre>