Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你能帮我解决这个问题吗?当用户打开应用程序或安装应用程序时,过程是自动移动某个文件夹中的文件。伙计们,任何建议、代码或链接都会有所帮助和赞赏......:D
提前致谢。
对于移动文件,您可以使用以下代码:
File from = new File(Environment.getExternalStorage().getAbsolutePath()+"/folder1/file.ext"); File to = new File(Environment.getExternalStorage().getAbsolutePath()+"/folder2/file.ext"); from.renameTo(to);
只需将此方法用于位于同一挂载点的文件夹。