android, How to rename a file?

前端 未结 9 2124
Happy的楠姐
Happy的楠姐 2020-11-28 09:58

In my application, I need to record video. Before start of recording in I\'m assigning a name and directory to it. After recording is finished user has ability to rename his

9条回答
  •  悲哀的现实
    2020-11-28 10:07

    Working example...

       File oldFile = new File("your old file name");
        File latestname = new File("your new file name");
        boolean success = oldFile .renameTo(latestname );
    
       if(success)
        System.out.println("file is renamed..");
    

提交回复
热议问题