1

Help me in converting a file name to own file name.

I tried the following but it did not work:

File file = new File("27.mp4");
File file1 = new File("abcd");
file1.rename(file);
ParkerHalo
  • 4,341
  • 9
  • 29
  • 51
Nandini
  • 21
  • 1
  • 2
  • Welcome to Stack Overflow! Would it be possible for you to provide the specific errors that you are getting? Please do take some time to read through [How to Ask](//stackoverflow.com/help/how-to-ask)! – Jia Jian Goi Feb 03 '16 at 10:52
  • 3
    Try to follow this link: http://stackoverflow.com/questions/10424997/android-how-to-rename-a-file – aletede91 Feb 03 '16 at 11:27

1 Answers1

1

The method is called renameTo:

File file = new File("27.mp4");
File file1 = new File("abcd");
file1.renameTo(file);
Henry
  • 42,982
  • 7
  • 68
  • 84