1

I want to implement a browser in android using webview. How can I open a context menu in a android webview whenever the user long press a link in the webview?

Brian Tompsett - 汤莱恩
  • 5,438
  • 68
  • 55
  • 126
Minh Pham
  • 870
  • 12
  • 22
  • possible duplicate of [Enable longClick in WebView](http://stackoverflow.com/questions/3449098/enable-longclick-in-webview) – TalkLittle Nov 24 '14 at 23:25

1 Answers1

1

Call Activity.openContextMenu(View v) in onLongPress. This would mean having the MyWebView keep a reference to the Activity though.

jlopez
  • 6,287
  • 2
  • 51
  • 90
  • 1
    The webview now just displays a context menu whenever I long press anywhere. How can I detect when a link is long pressed? – Minh Pham Feb 15 '13 at 03:08