This commit is contained in:
Joe Bowser 2012-04-23 10:33:37 -07:00
commit ca66c4bf59
4 changed files with 6 additions and 33 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -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();