나는 얻고있다
열지 못했습니다 :
EACCES (Permission denied)
줄에 OutputStream myOutput = new FileOutputStream(outFileName);
나는 뿌리를 확인하고 시도했다 android.permission.WRITE_EXTERNAL_STORAGE
.
이 문제를 어떻게 해결할 수 있습니까?
try {
InputStream myInput;
myInput = getAssets().open("XXX.db");
// Path to the just created empty db
String outFileName = "/data/data/XX/databases/"
+ "XXX.db";
// Open the empty db as the output stream
OutputStream myOutput = new FileOutputStream(outFileName);
// Transfer bytes from the inputfile to the outputfile
byte[] buffer = new byte[1024];
int length;
while ((length = myInput.read(buffer)) > 0) {
myOutput.write(buffer, 0, length);
}
// Close the streams
myOutput.flush();
myOutput.close();
myInput.close();
buffer = null;
outFileName = null;
}
catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}