The task seems to be trivial, that's just having difficulty.
I get the address of the file in the onActivityResult method after which I create it
File file = new File(data.getData().getPath()); The creation is successful, there are no questions. Then I try to rename the file like this:
File file = new File(data.getData().getPath()); File file2 = new File(data.getData().getPath(),"324234235461.txt"); file1.renameTo(file2); Alas, nothing happens. The file is left with the name that was received during the constructor call new File(data.getData().getPath());