String filename = "MyApp/MediaTag/MediaTag-"+objectId+".png"; File file = new File(Environment.getExternalStorageDirectory(), filename); FileOutputStream fos; fos = new FileOutputStream(file); fos.write(mediaTagBuffer); fos.flush(); fos.close();However, it's throwing this exception at me:
java.io.FileNotFoundException: /mnt/sdcard/MyApp/MediaCard/MediaCard-0.png (No such file or directory)Now, I've set the filename to "MyApp/MediaTag-"+objectId+" and it worked but when I create / save the file to another directory, the exception appears again. Anybody know what I'm doing wrong?
Discuss This Question: