Guest User

Untitled

a guest
Jun 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1.  
  2. FileObserver f;
  3.  
  4. f = createWatchList("/sdcard/");
  5. f.startWatching();
  6. watchList.add(f);
  7. f = createWatchList("/sdcard/tmp");
  8. f.startWatching();
  9. watchList.add(f);
  10. }
  11.  
  12. private FileObserver createWatchList(String path){
  13. File file = new File(path);
  14. if (file == null || ! file.isDirectory()){
  15. Log.d(TAG, "path is not directory.");
  16. return null;
  17. }
  18.  
  19. return new PathFileObserver(path);
  20. }
Add Comment
Please, Sign In to add comment