Wednesday, 7 May 2014

Moving a File From One Directory To Another Directory In Android Programmatically (SIMPLE)

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.");
}

1 comment: