diff --git a/framework/assets/js/cordova.android.js b/framework/assets/js/cordova.android.js index 89ffd34e..b090ac40 100755 --- a/framework/assets/js/cordova.android.js +++ b/framework/assets/js/cordova.android.js @@ -1029,8 +1029,6 @@ module.exports = { } if (db === null) { - // TOOD: this is wrong - setupDroidDB(); return storage.openDatabase(name, version, desc, size); } else { diff --git a/framework/src/org/apache/cordova/Storage.java b/framework/src/org/apache/cordova/Storage.java index 365383d0..62e635c2 100755 --- a/framework/src/org/apache/cordova/Storage.java +++ b/framework/src/org/apache/cordova/Storage.java @@ -162,7 +162,7 @@ public class Storage extends Plugin { try { if (isDDL(query)) { this.myDb.execSQL(query); - this.sendJavascript("droiddb.completeQuery('" + tx_id + "', '');"); + this.sendJavascript("require('cordova/plugin/android/storage').completeQuery('" + tx_id + "', '');"); } else { Cursor myCursor = this.myDb.rawQuery(query, params); @@ -175,7 +175,7 @@ public class Storage extends Plugin { System.out.println("Storage.executeSql(): Error=" + ex.getMessage()); // Send error message back to JavaScript - this.sendJavascript("droiddb.fail('" + ex.getMessage() + "','" + tx_id + "');"); + this.sendJavascript("require('cordova/plugin/android/storage').fail('" + ex.getMessage() + "','" + tx_id + "');"); } } @@ -233,7 +233,7 @@ public class Storage extends Plugin { } // Let JavaScript know that there are no more rows - this.sendJavascript("droiddb.completeQuery('" + tx_id + "', " + result + ");"); + this.sendJavascript("require('cordova/plugin/android/storage').completeQuery('" + tx_id + "', " + result + ");"); } }