SourceFilePath is the current path of which file you are going to move
DestinationFilePath is the path where you are going to move that file
File SourceFile = new File(SourceFilePath);
File DestinationFile = new File(DestinationFilePath);
if(SourceFile.renameTo(DestinationFile))
{
Log.v("Moving", "Moving file successful.");
}
else
{
Log.v("Moving", "Moving file failed.");
}
It is very simple and best code.
ReplyDeleteThank you....