I have 2 files, File src = new File("loc/xyz.mp3") and File dst=new File("loc/xyz1.mp3") Now I want to rename dst to xyz.mp3, and delete src . How can i do this? I have tried,
src.delete(); dst.renameTo(src);
I run this in AsyncTask in the background in my application, when I run it the first time, it works fine, but the second time it crashes. Please help me with this.
source share