Okay, if you want to add a context menu to the web view you will need to do the following. In the main application class that extends DroidGap you will need to add the following line to the onCreate method:
this.registerForContextMenu(this.appView);
then you'll need to add the following two methods to the same Java class:
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.example, menu);
}
Of course you'll need to update the R.menu.example to the name of your menu's XML file.
@Override
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
switch (item.getItemId()) {
case R.id.settings:
this.startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS));
return true;
case R.id.help:
this.appView.sendJavascript("navigator.notification.alert('No help')");
return true;
default:
return super.onContextItemSelected(item);
}
}
and in this method you'll need to handle all your menu option activities.