Copied android db file is empty
<p>I'm trying to copy an android db file from my application folder to another one on SD card. And from DDMS file explorer i can notice that the copied file size is 0. This is my code bellow.</p>

<pre><code>public boolean copyDBFile(){
    File dbFile =new File(Environment.getDataDirectory() + DB_PATH);
    File exportDir = new File(Environment.getExternalStorageDirectory()
      + "/BACKUP_DIR");
    if (!exportDir.exists()) {
        exportDir.mkdirs();
    }

    File file = new File(exportDir, dbFile.getName());
    try {
        file.createNewFile();           
        copyFile(dbFile, file);
        return true;
    } catch (IOException e) {     
        return false;
    }
}


public void copyFile(File src, File dst) throws IOException {
    FileChannel inChannel = new FileInputStream(src).getChannel();
    FileChannel outChannel = new FileOutputStream(dst).getChannel();

    try {
        inChannel.transferTo(0, inChannel.size(), outChannel);
    } finally {
        if (inChannel != null)
          inChannel.close();
        if (outChannel != null)
          outChannel.close();
    }
}
</code></pre>

<p>Is it a permission issue? Thanks for help.</p>
