mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 09:02:50 +08:00
Fix WebSQL for Android 4.0.2.
This commit is contained in:
parent
3ebc1d71df
commit
d2fc08959a
@ -1029,8 +1029,6 @@ module.exports = {
|
||||
}
|
||||
|
||||
if (db === null) {
|
||||
// TOOD: this is wrong
|
||||
setupDroidDB();
|
||||
return storage.openDatabase(name, version, desc, size);
|
||||
}
|
||||
else {
|
||||
|
@ -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 + ");");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user