2011-04-06 50 views

回答

6

你可以試試這個:

try { 
    File sd = Environment.getExternalStorageDirectory(); 

    if (sd.canWrite()) { 
     String sourcePath= "/path/to/source/file.mp3"; 
     String destinationPath= "/path/to/destination/file.mp3"; 
     File source= new File(sd, sourcePath); 
     File destination= new File(sd, destinationPath); 
     if (source.exists()) { 
      FileChannel src = new FileInputStream(source).getChannel(); 
      FileChannel dst = new FileOutputStream(destination).getChannel(); 
      dst.transferFrom(src, 0, src.size()); 
      src.close(); 
      dst.close(); 
     } 
} catch (Exception e) {} 
+0

非常感謝它的工作就像一個魅力! (^_^)問題解決了! – Farhan 2011-04-06 05:54:58

+0

@Fhan你不客氣:) – evilone 2011-04-06 05:58:30