title: How unmount programmatically USB DRIVE in Android 4.2
body: <p>I have read many posts on this topic, but I have not found a solution yet. 
  In my application I need to unmount the USB DRIVE after copying files from USB DRIVE to the tablet, so I can safely remove it without using the Settings menu.</p>
  
  <p>Right now I am using this method:</p>
  
  <pre><code>Utility.copyDirectory(file,new File(_CURR_FOLDER));
  Process su;
  su = Runtime.getRuntime().exec("/system/bin/su");
  String cmd = "umount" +
               " " + SDPath + "\n" + "exit\n";
               su.getOutputStream().write(cmd.getBytes());
  </code></pre>
  
  <p>What I get in the storage settings is:</p>
  
  <blockquote>
    <p>Total space 0.0
    Available 0.0</p>
  </blockquote>
  
  <p>but SD is still mounted.</p>
  
  <p>Thank you in advance for your help.</p>
  
  <p>First Edit:</p>
  
  <p>Someone know how use IMountService? I read about it, and maybe is the right way to solve the unmount of USB DRIVE, but after adding <code>classes-full-debug.jar</code> my project is no longer compiled</p>