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
/**
* ReName any file
* @param oldName
* @param newName
*/
public static void renameFile(String oldName,String newName){
File dir = Environment.getExternalStorageDirectory();
if(dir.exists()){
File from = new File(dir,oldName);
File to = new File(dir,newName);
if(from.exists())
from.renameTo(to);
}
}