I red different question here on StackOverflow but mine is a little bit newer.
All of these don't work: Question1 Question2 Question3
I updated my devices to Android KitKat 4.4 and when I try to copy database with this code:
private void copyDataBase() throws IOException {
InputStream myInput = context.getAssets().open(DB_NAME);
String outFileName = DB_PATH + DB_NAME;
OutputStream myOutput = new FileOutputStream(outFileName);
byte[] buffer = new byte[1024];
int length;
while ((length = myInput.read(buffer)) > 0) {
myOutput.write(buffer, 0, length);
}
myOutput.flush();
myOutput.close();
myInput.close();
}
I obtain a FileNotFoundException at line:
OutputStream myOutput = new FileOutputStream(outFileName);
Someone fix this issue on Android KitKat??? (other platforms works great)
Thanks for help.
Giulio