diff --git a/bin/templates/project/cordova/debug b/bin/templates/project/cordova/debug index 8dd31874..0bac2c79 100755 --- a/bin/templates/project/cordova/debug +++ b/bin/templates/project/cordova/debug @@ -4,6 +4,6 @@ # if there are no devices listed then emulate - +ant clean ant debug install adb shell am start -n $PACKAGE/$PACKAGE.$ACTIVITY diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java index 24fedd20..85a217fd 100755 --- a/framework/src/org/apache/cordova/DroidGap.java +++ b/framework/src/org/apache/cordova/DroidGap.java @@ -918,31 +918,6 @@ public class DroidGap extends Activity implements CordovaInterface { this.finish(); } - - /** - * Called when the back key is pressed - * - * (non-Javadoc) - * @see android.app.Activity#onBackPressed() - */ - /* - @Override - public void onBackPressed() - { - Log.d("BackPressed", "in onBackPressed"); - Log.d("BackPressed", "bound = " + this.bound); - //Log.d("BackPressed", "backHistory = " + this.backHistory()); - // If back key is bound, then send event to JavaScript - - if (!(this.bound || this.backHistory())) { - Log.d("BackPressed", "exiting"); - this.activityState = ACTIVITY_EXITING; - super.onBackPressed(); - } - } - */ - - /** * Called when a key is de-pressed. (Key UP) * @@ -957,11 +932,8 @@ public class DroidGap extends Activity implements CordovaInterface { // If back key if (keyCode == KeyEvent.KEYCODE_BACK) { - Log.d("BackButton", "I got an up from KEYCODE_BACK"); - // If back key is bound, then send event to JavaScript if (this.bound) { - Log.d("BackButton", "bound is true firing an event to JS"); this.appView.loadUrl("javascript:cordova.fireDocumentEvent('backbutton');"); return true; } else { @@ -990,7 +962,6 @@ public class DroidGap extends Activity implements CordovaInterface { return true; } - Log.d("BackPressed", "returning false"); return false; } diff --git a/framework/src/org/apache/cordova/NetworkManager.java b/framework/src/org/apache/cordova/NetworkManager.java index 61e64598..6ef0c3ee 100755 --- a/framework/src/org/apache/cordova/NetworkManager.java +++ b/framework/src/org/apache/cordova/NetworkManager.java @@ -58,7 +58,7 @@ public class NetworkManager extends Plugin { public static final String LTE = "lte"; public static final String UMB = "umb"; public static final String HSPA_PLUS = "hspa+"; - // return types + // return type public static final String TYPE_UNKNOWN = "unknown"; public static final String TYPE_ETHERNET = "ethernet"; public static final String TYPE_WIFI = "wifi"; @@ -123,6 +123,7 @@ public class NetworkManager extends Plugin { this.connectionCallbackId = callbackId; NetworkInfo info = sockMan.getActiveNetworkInfo(); PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, this.getConnectionInfo(info)); + pluginResult.setKeepCallback(true); return pluginResult; } @@ -195,6 +196,7 @@ public class NetworkManager extends Plugin { */ private void sendUpdate(String type) { PluginResult result = new PluginResult(PluginResult.Status.OK, type); + result.setKeepCallback(true); this.success(result, this.connectionCallbackId); // Send to all plugins diff --git a/framework/src/org/apache/cordova/Notification.java b/framework/src/org/apache/cordova/Notification.java index a0778e18..8d5e7584 100755 --- a/framework/src/org/apache/cordova/Notification.java +++ b/framework/src/org/apache/cordova/Notification.java @@ -234,7 +234,7 @@ public class Notification extends Plugin { // First button if (fButtons.length > 0) { - dlg.setPositiveButton(fButtons[0], + dlg.setNegativeButton(fButtons[0], new AlertDialog.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); @@ -256,7 +256,7 @@ public class Notification extends Plugin { // Third button if (fButtons.length > 2) { - dlg.setNegativeButton(fButtons[2], + dlg.setPositiveButton(fButtons[2], new AlertDialog.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss();