servas,
i tried to implement a context menu for a webview, but could not
succeed, although my code works for buttons. i could not google any
useful source snippets, so it came in mind, that contextmenu's for
webview do not work???
i tried the following code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WebView webview = new WebView(this);
setContentView(webview);
webview.setOnCreateContextMenuListener(new
OnCreateContextMenuListener() {
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
menu.add(0, 1, 0, "TEST1");
Log.d("TEST","CONTEXT1");
}
});
webview.loadData(sHTML, "text/html", "utf-8");
}
does anyone have a working example of a contextmenu for webviews?????
a workaround i've found is webview.setOnTouchListener, and upon
MotionEvent.ACTION_UP I'm displaying a dialog. this is working, but
not a very fine method ...
ciao
H.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe, reply using "remove me" as the subject.