Android Programming Press on the image to return to the main documentation page.

WebViewExtras

Written by Martin Pearman

List of types:

WebViewExtras

WebViewExtras


Events:

None

Members:


  addJavascriptInterface (webView1 As android.webkit.WebView, interfaceName As String)

  addWebChromeClient (webView1 As android.webkit.WebView)

  clearCache (webView1 As android.webkit.WebView, includeDiskFiles As Boolean)

  executeJavascript (webView1 As android.webkit.WebView, javascriptStatement As String)

  flingScroll (webView1 As android.webkit.WebView, vx As Int, vy As Int)

  pageDown (webView1 As android.webkit.WebView, scrollToBottom As BooleanAs Boolean

  pageUp (webView1 As android.webkit.WebView, scrollToTop As BooleanAs Boolean

  zoomIn (webView1 As android.webkit.WebView) As Boolean

  zoomOut (webView1 As android.webkit.WebView) As Boolean

Members description:

addJavascriptInterface (webView1 As android.webkit.WebView, interfaceName As String)
Add a javascript interface to webView1, methods of the interface can be accessed using javascript with the interfaceName as the javascript namespace.

webView1 - The WebView to add the interface to.
interfaceName - The javascript namespace (prefix) that will be used to access the interface methods.
addWebChromeClient (webView1 As android.webkit.WebView)
Add a WebChromeClient to webView1.
The WebChromeVlient will handle console logging and javascript modal dialogs.

webView1 - The WebView to add the WebChromeClient to.
clearCache (webView1 As android.webkit.WebView, includeDiskFiles As Boolean)
Clear the WebView cache.
Note that the cache is per-application, so this will clear the cache for all WebViews used in an application.

webView1 - A WebView in your application.
includeDiskFiles - If false, only the RAM cache is cleared.
executeJavascript (webView1 As android.webkit.WebView, javascriptStatement As String)
Executes a string of one or more javascript statements in webView1.

webView1 - The WebView to execute the javascript in.
javascriptStatement - A string of one or more (semi-colon seperated) javascript statements.
flingScroll (webView1 As android.webkit.WebView, vx As Int, vy As Int)
flingScroll is a poorly documented method of the WebView.
It's included in WebViewExtras as it may be useful but i can find no documentation for it or it's parameters.

webView1 - The WebView to flingScroll.
vx - No documentation available.
vy - No documentation available.
pageDown (webView1 As android.webkit.WebView, scrollToBottom As BooleanAs Boolean
Scroll the contents of webView1 down by half the page size.

webView1 - The WebView to scroll.
scrollToBottom - If true then webView1 will be scrolled to the bottom of the page.

Returns a Boolean value to indicate the success or failure of the scroll.
pageUp (webView1 As android.webkit.WebView, scrollToTop As BooleanAs Boolean
Scroll the contents of webView1 up by half the page size.

webView1 - The WebView to scroll.
scrollToTop - If true then webView1 will be scrolled to the top of the page.

Returns a Boolean value to indicate the success or failure of the scroll.
zoomIn (webView1 As android.webkit.WebView) As Boolean
Perform zoom in on webView1.

webView1 - The WebView to zoom in on.

Returns a Boolean value to indicate the success or failure of the zoom.
zoomOut (webView1 As android.webkit.WebView) As Boolean
Perform zoom out on webView1.

webView1 - The WebView to zoom out on.

Returns a Boolean value to indicate the success or failure of the zoom.
Top