Created
November 9, 2012 20:29
-
-
Save macdonst/4048040 to your computer and use it in GitHub Desktop.
Context Menu Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
super.init(); | |
this.registerForContextMenu(this.appView); | |
super.loadUrl("file:///android_asset/www/index.html"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment