Code example for FileObserver

Methods: stopWatching

0
	} 
	 
	@Override 
	public void onDestroy() { 
		pinMarkerDataSource.close();
		observer.stopWatching();
		super.onDestroy(); 
	} 
	 
	/** 
	 * Initiate a single observer of a given directory 
	 * @param partial path of the directory to keep watch of. 
	 */ 
	private FileObserver initSingleDirectoryObserver(String directoryPath) {
		final String dirPath = directoryPath;
		FileObserver observer = new FileObserver(directoryPath) {
			@Override 
			public void onEvent(int event, String file) {
				String filePath = dirPath + "/" + file;
				if (event == FileObserver.CREATE) {
					Location lastKnown = locationManager.getLastKnownLocation(provider);