0

I have a Webview in an Android App. Any type of content(pdf,png,doc) will be loaded in the Webview. I need to disable the input controls (checkbox, inputbox) in the Webview content. And If we use onTouchListener, the zooming controls should not work. Do anyone help me out on this please?

Nilesh Panchal
  • 1,059
  • 1
  • 10
  • 24
DayanaK
  • 1
  • 4

1 Answers1

0

Try this may it will help you

myWebview.clearFocus()
myWebview.getSettings().setBuiltInZoomControls(false);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
    // Use the API 11+ calls to disable the controls
    // Use a seperate class to obtain 1.6 compatibility
    new Runnable() {
      public void run() {
        myWebview.getSettings().setDisplayZoomControls(false);
      }
    }.run();
  }
myWebView.setOnTouchListener(null)
myWebview.setClickable(false)
myWebView.setEnabled(false)

Add the following property to webview inside your layout.xml file

android:clickable="false"
android:longClickable="false"

Checked out this and this answer also.

Nilesh Panchal
  • 1,059
  • 1
  • 10
  • 24