In my Android application, I want to rename the file name at runtime. How can I do it?
This is my code:
String[] command = {\" mv\", \"sun moon.jpg\"
you can also explicitly give the full path without specifying directory...
File file = new File("Path of file which you want to rename"); File file2 = new File("new name for the file"); boolean success = file.renameTo(file2);