File mediaDir = new File(\"media\");
if (!mediaDir.exists()){
mediaDir.createNewFile();
mediaDir.mkdir();
}
File f = new File(\"/data/data/com.test.image/f
You are creating file in Android system's root directory for which no application is allowed to.
To create directory specific to your application, use getDir(String dirName, int mode) instead of new File("media")
. By calling only, you can create media directory and use it.
No need to do so many stuffs what you are doing in your above code. Also no need to give any permission in manifest too.