How to move/rename file from internal app storage to external storage on Android?

后端 未结 8 1188
闹比i
闹比i 2020-11-29 02:21

I am downloading files from the internet and saving the streaming data to a temp file in my app\'s internal storage given by getFilesDir().

Once the download is comp

8条回答
  •  生来不讨喜
    2020-11-29 02:57

    For Move file best way is Renaming it's path with different path and name example:

    File from = new File(Environment.getExternalStorage().getAbsolutePath()+"/kaic1/imagem.jpg");
    File to = new File(Environment.getExternalStorage().getAbsolutePath()+"/kaic2/imagem.jpg");
    from.renameTo(to);
    

提交回复
热议问题