android, How to rename a file?

前端 未结 9 2123
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:29

    you should check if the directory exist!

    File directory = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES), MEDIA_NAME);
    if(!directory.exist()){
        directory.mkdirs();
    }
    

提交回复
热议问题