Code example for FileObserver

Methods: startWatching

0
 
	startServers(); 
	IntentFilter filterSend = new IntentFilter();
	filterSend.addAction("com.makewithmoto.intent.action.STOP_SERVER");
	registerReceiver(mStopServerReceiver, filterSend);
	observer.startWatching();
    } 
 
    /** 
     * onPause 
     */ 
    @Override 
    protected void onPause() { 
	super.onPause(); 
 
	EventBus.getDefault().unregister(this);
	unregisterReceiver(mStopServerReceiver);
	observer.stopWatching();
	unregisterReceiver(connectivityChangeReceiver);
 
    }