mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-cordova-android into CordovaWebView
This commit is contained in:
commit
ca66c4bf59
@ -4,6 +4,6 @@
|
|||||||
|
|
||||||
# if there are no devices listed then emulate
|
# if there are no devices listed then emulate
|
||||||
|
|
||||||
|
ant clean
|
||||||
ant debug install
|
ant debug install
|
||||||
adb shell am start -n $PACKAGE/$PACKAGE.$ACTIVITY
|
adb shell am start -n $PACKAGE/$PACKAGE.$ACTIVITY
|
||||||
|
@ -918,31 +918,6 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
this.finish();
|
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)
|
* Called when a key is de-pressed. (Key UP)
|
||||||
*
|
*
|
||||||
@ -957,11 +932,8 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
// If back key
|
// If back key
|
||||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
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 back key is bound, then send event to JavaScript
|
||||||
if (this.bound) {
|
if (this.bound) {
|
||||||
Log.d("BackButton", "bound is true firing an event to JS");
|
|
||||||
this.appView.loadUrl("javascript:cordova.fireDocumentEvent('backbutton');");
|
this.appView.loadUrl("javascript:cordova.fireDocumentEvent('backbutton');");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@ -990,7 +962,6 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d("BackPressed", "returning false");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public class NetworkManager extends Plugin {
|
|||||||
public static final String LTE = "lte";
|
public static final String LTE = "lte";
|
||||||
public static final String UMB = "umb";
|
public static final String UMB = "umb";
|
||||||
public static final String HSPA_PLUS = "hspa+";
|
public static final String HSPA_PLUS = "hspa+";
|
||||||
// return types
|
// return type
|
||||||
public static final String TYPE_UNKNOWN = "unknown";
|
public static final String TYPE_UNKNOWN = "unknown";
|
||||||
public static final String TYPE_ETHERNET = "ethernet";
|
public static final String TYPE_ETHERNET = "ethernet";
|
||||||
public static final String TYPE_WIFI = "wifi";
|
public static final String TYPE_WIFI = "wifi";
|
||||||
@ -123,6 +123,7 @@ public class NetworkManager extends Plugin {
|
|||||||
this.connectionCallbackId = callbackId;
|
this.connectionCallbackId = callbackId;
|
||||||
NetworkInfo info = sockMan.getActiveNetworkInfo();
|
NetworkInfo info = sockMan.getActiveNetworkInfo();
|
||||||
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, this.getConnectionInfo(info));
|
PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, this.getConnectionInfo(info));
|
||||||
|
pluginResult.setKeepCallback(true);
|
||||||
return pluginResult;
|
return pluginResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,6 +196,7 @@ public class NetworkManager extends Plugin {
|
|||||||
*/
|
*/
|
||||||
private void sendUpdate(String type) {
|
private void sendUpdate(String type) {
|
||||||
PluginResult result = new PluginResult(PluginResult.Status.OK, type);
|
PluginResult result = new PluginResult(PluginResult.Status.OK, type);
|
||||||
|
result.setKeepCallback(true);
|
||||||
this.success(result, this.connectionCallbackId);
|
this.success(result, this.connectionCallbackId);
|
||||||
|
|
||||||
// Send to all plugins
|
// Send to all plugins
|
||||||
|
@ -234,7 +234,7 @@ public class Notification extends Plugin {
|
|||||||
|
|
||||||
// First button
|
// First button
|
||||||
if (fButtons.length > 0) {
|
if (fButtons.length > 0) {
|
||||||
dlg.setPositiveButton(fButtons[0],
|
dlg.setNegativeButton(fButtons[0],
|
||||||
new AlertDialog.OnClickListener() {
|
new AlertDialog.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
@ -256,7 +256,7 @@ public class Notification extends Plugin {
|
|||||||
|
|
||||||
// Third button
|
// Third button
|
||||||
if (fButtons.length > 2) {
|
if (fButtons.length > 2) {
|
||||||
dlg.setNegativeButton(fButtons[2],
|
dlg.setPositiveButton(fButtons[2],
|
||||||
new AlertDialog.OnClickListener() {
|
new AlertDialog.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
|
Loading…
Reference in New Issue
Block a user