Code example for FileObserver

Methods: startWatching

0
 
@Override 
protected void onResume() { 
   // TODO Auto-generated method stub 
   super.onResume(); 
   mFileObserver.startWatching();
} 
 
public void saveMedia(String fileName, byte[] data) {
 
   String imagePath = "/sdcard/sam/";
   System.out.println("Inside Folder");
 
 
   File file = new File(imagePath, fileName);
   System.out.println("File Created");
 
   FileOutputStream fileOutputStream = null;
   try { 
       fileOutputStream = new FileOutputStream(file);
Stop searching for code, let great code find you!  Add Codota to your java IDE