public static void save() {
      String dbpath = "/data/data/tl.cac.view/databases/"
      +"afinal.db";
      boolean success=copyFile(dbpath, Environment.getExternalStorageDirectory() + "/"
      + "afinal.db");
}

public static boolean copyFile(String source, String dest) {
try {
     File f1 = new File(source);
     File f2 = new File(dest);
     InputStream in = new FileInputStream(f1);
     OutputStream out = new FileOutputStream(f2);

     byte[] buf = new byte[1024];
     int len;
     while ((len = in.read(buf)) > 0)
     out.write(buf, 0, len);

     in.close();
     out.close();
} catch (FileNotFoundException ex) {
     return false;
} catch (IOException e) {
     return false;
}
    return true;
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-01-08
猜你喜欢
  • 2022-01-16
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
相关资源
相似解决方案