1

I have a layout that features a webview and various UI elements on top of the webview. This is a relativelayout.

Currently, no matter how many elements are visible on top of the webview, all scrolling will scroll the webview, it can still accept clicks and more. I want to conditionally disable these features of the webview

I am using myWebview.setClickable(false) but this seems to have no effect

insight appreciated

CQM
  • 42,592
  • 75
  • 224
  • 366
  • 1
    see if this answers your question http://stackoverflow.com/questions/2527899/disable-scrolling-in-webview – Kevin Qiu Jul 19 '11 at 22:25

1 Answers1

2

I'm not confident about this, but perhaps forcing the WebView to drop its focus will do. Try myWebview.clearFocus(). Let me know if that worked or not. I'm not at my computer right now, otherwise I would know. :)

Brian
  • 7,955
  • 16
  • 66
  • 107
  • It did not work, I was able to disable input now with `mainContent.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { return(event.getAction() == MotionEvent.ACTION_MOVE); } });` but now I am trying to disable that listener later on! – CQM Jul 19 '11 at 22:48
  • 2
    Hmm... try one of these two `myWebView.setEnabled(false)` and/or `myWebView.setOnTouchListener(null)`. I'm just trying to run down the list of possible disabling tactics. Good luck! :) – Brian Jul 19 '11 at 22:53
  • simply setting the listener to null worked for me! I kept reading that it wouldn't work – CQM Jul 19 '11 at 23:08