Skip to content
Browse files

Change based on new message passing API in IPlugin

  • Loading branch information...
1 parent 29c7e12 commit 9409caad69f812564c2a83db3099ff72cb41e525 @infil00p infil00p committed Nov 16, 2011
Showing with 28 additions and 1 deletion.
  1. +28 −1 framework/src/com/phonegap/DroidGap.java
View
29 framework/src/com/phonegap/DroidGap.java
@@ -51,6 +51,8 @@ Licensed to the Apache Software Foundation (ASF) under one
import android.util.Log;
import android.view.Display;
import android.view.KeyEvent;
+import android.view.Menu;
+import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
@@ -1499,7 +1501,7 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
// If menu key
else if (keyCode == KeyEvent.KEYCODE_MENU) {
this.appView.loadUrl("javascript:PhoneGap.fireDocumentEvent('menubutton');");
- return true;
+ return super.onKeyDown(keyCode, event);
}
// If search key
@@ -1825,4 +1827,29 @@ private boolean isUrlWhiteListed(String url) {
return false;
}
+ /*
+ * Hook in DroidGap for menu plugins
+ *
+ */
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu)
+ {
+ this.onMessage("onCreateOptionsMenu", menu);
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onPrepareOptionsMenu(Menu menu)
+ {
+ this.onMessage("onPrepareOptionsMenu", menu);
+ return super.onPrepareOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item)
+ {
+ this.onMessage("onOptionsItemSelected", item);
+ return true;
+ }
}

0 comments on commit 9409caa

Please sign in to comment.
Something went wrong with that request. Please try again.