title: How can a PhoneGap plugin change the menu on Android?
body: <p>I've written a PhoneGap plugin for Android that gets called from the browser on various events, and I'd like it to affect what menu items are shown when the Menu button is pressed. For example, I'd like to disable a certain event, or add certain items. Following the directions <a href="http://developer.android.com/guide/topics/ui/menus.html#ChangingTheMenu" rel="nofollow">on the Android site</a>, I know I need to override <code>onPrepareOptionsMenu()</code> to dynamically change the menu items.</p>
  
  <p>Currently, my solution involves writing a file in the plugin, and then parsing that file in onPrepareOptionsMenu. Is there a better way of doing this? And is there any way to get a handle to the main <code>Activity</code> from the plugin?</p>
  
  <p>edit: One other way I've just done is to use a public static variable in the main Activity class that I access from the plugin.</p>