mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-09 18:26:38 +02:00
close database before importing the database
This commit is contained in:
@@ -461,6 +461,10 @@ public class OpenScale {
|
|||||||
File tmpExportFile = context.getApplicationContext().getDatabasePath("openScale_tmp.db");
|
File tmpExportFile = context.getApplicationContext().getDatabasePath("openScale_tmp.db");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (appDB != null) {
|
||||||
|
appDB.close();
|
||||||
|
}
|
||||||
|
|
||||||
copyFile(Uri.fromFile(exportFile), Uri.fromFile(tmpExportFile));
|
copyFile(Uri.fromFile(exportFile), Uri.fromFile(tmpExportFile));
|
||||||
copyFile(importFile, Uri.fromFile(exportFile));
|
copyFile(importFile, Uri.fromFile(exportFile));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user