ContextMenu for WebView

by hkrebs » Wed, 14 Apr 2010 03:35:21 GMT

Sponsored Links

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) {
  WebView webview = new WebView(this);
OnCreateContextMenuListener() {
    public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
      menu.add(0, 1, 0, "TEST1");
  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 ...



Other Threads

1. [WTA] Samsung Galaxy Tab CDMA

Samsung Galaxy Tab keluaran Sprint (versi CDMA), system inject atau Ruim ya?
Tertarik nih kalau bisa pakai Smart EVDO Rev-A :D

Cara untuk unlock nya gampang nggak ya?
Setahu ane kalau dapet dari eBay kan locked.

Thank you infonya....

Deska Affif
088-1100-GAYA (4292) | Y!: GadgetGaya  |  Bikin Gadgetmu Makin Gaya!


2. StageFright - Seems like HTTPStream mHTTP in NuHTTPDataSource is not allocated/constructed

I see no constructor for this field in NuHTTPDataSource.
Used in AwsamePlayer finishSetDataSource_l


3. Porting Android on MTK6516

4. WTH: Galaxy Tab ada pesan downloading 鈥

5. Samsung Galaxy Tab CDMA

6. F

7. using getSurfaceFrame to get display width/height?