Example usage for Java android.webkit WebView fields, constructors, methods, implement or subclass
The text is from its open source code.
String | SCHEME_TEL URI scheme for telephone number. |
String | SCHEME_MAILTO URI scheme for email address. |
WebView(Context context) Constructs a new WebView with an Activity Context object. |
void | addJavascriptInterface(Object object, String name) Injects the supplied Java object into this WebView. |
void | buildDrawingCache() Calling this method is equivalent to calling |
boolean | canGoBack() Gets whether this WebView has a back history item. |
boolean | canGoForward() Gets whether this WebView has a forward history item. |
Picture | capturePicture() Gets a new picture that captures the current contents of this WebView. |
void | clearCache(boolean includeDiskFiles) Clears the resource cache. |
void | clearFormData() Removes the autocomplete popup from the currently focused form field, if present. |
void | clearHistory() Tells this WebView to clear its internal back/forward list. |
void | clearMatches() Clears the highlighting surrounding text matches created by #findAllAsync . |
void | clearView() Clears this WebView so that onDraw() will draw nothing but white background, and onMeasure() will return 0 if MeasureSpec is not MeasureSpec.EXACTLY. |
WebBackForwardList | copyBackForwardList() Gets the WebBackForwardList for this WebView. |
PrintDocumentAdapter | createPrintDocumentAdapter() |
PrintDocumentAdapter | createPrintDocumentAdapter(String documentName) Creates a PrintDocumentAdapter that provides the content of this WebView for printing. |
void | destroy() Destroys the internal state of this WebView. |
void | destroyDrawingCache() Frees the resources used by the drawing cache. |
void | disablePlatformNotifications() Disables platform notifications of data state and proxy changes. |
void | draw(Canvas canvas) Manually render this view (and all of its children) to the given Canvas. |
void | enablePlatformNotifications() Enables platform notifications of data state and proxy changes. |
void | enableSlowWholeDocumentDraw() For apps targeting the L release, WebView has a new default behavior that reduces memory footprint and increases performance by intelligently choosing the portion of the HTML document that needs to be drawn. |
void | evaluateJavascript(String script, @Nullable ValueCallback Asynchronously evaluates JavaScript in the context of the currently displayed page. |
String | findAddress(String addr) Gets the first substring consisting of the address of a physical location. |
void | findAllAsync(String find) Finds all instances of find on the page and highlights them, asynchronously. |
T | findViewById(@IdRes int id) Finds the first descendant view with the given ID, the view itself if the ID matches #getId() , or null if the ID is invalid (< 0) or there is no matching view in the hierarchy. |
Drawable | getBackground() Gets the background drawable |
SslCertificate | getCertificate() Gets the SSL certificate for the main top-level page or null if there is no certificate (the site is not secure). |
Class> | getClass() Returns the runtime class of this Object . |
int | getContentHeight() Gets the height of the HTML content. |
Context | getContext() Returns the context the view is running in, through which it can access the current theme, resources, etc. |
Bitmap | getDrawingCache() Calling this method is equivalent to calling |
Handler | getHandler() |
int | getHeight() Return the height of your view. |
HitTestResult | getHitTestResult() Gets a HitTestResult based on the current cursor node. |
String[] | getHttpAuthUsernamePassword(String host, String realm) Retrieves HTTP authentication credentials for a given host and realm from the WebViewDatabase instance. |
int | getId() Returns this view's identifier. |
int | getLayerType() Indicates what type of layer is currently associated with this view. |
ViewGroup.LayoutParams | getLayoutParams() Get the LayoutParams associated with this view. |
int | getMeasuredHeight() Like #getMeasuredHeightAndState() , but only returns the raw height component (that is the result is masked by #MEASURED_SIZE_MASK ). |
int | getMeasuredWidth() Like #getMeasuredWidthAndState() , but only returns the raw width component (that is the result is masked by #MEASURED_SIZE_MASK ). |
String | getOriginalUrl() Gets the original URL for the current page. |
ViewParent | getParent() Gets the parent of this view. |
PluginList | getPluginList() Gets the list of currently loaded plugins. |
Resources | getResources() Returns the resources associated with this view. |
float | getScale() Gets the current scale of this WebView. |
int | getScrollY() Return the scrolled top position of this view. |
WebSettings | getSettings() Gets the WebSettings object used to control the settings for this WebView. |
Object | getTag() Returns this view's tag. |
String | getTitle() Gets the title for the current page. |
String | getUrl() Gets the URL for the current page. |
int | getWidth() Return the width of your view. |
void | goBack() Goes back in the history of this WebView. |
void | goForward() Goes forward in the history of this WebView. |
int | hashCode() Returns a hash code value for the object. |
void | invalidate() Invalidate the whole view. |
boolean | isFocusable() Returns whether this View is currently able to take focus. |
boolean | isFocusableInTouchMode() When a view is focusable, it may not want to take focus when in touch mode. |
boolean | isShown() Returns the visibility of this view and all of its ancestors |
void | layout(int l, int t, int r, int b) |
void | loadData(String data, @Nullable String mimeType, @Nullable String encoding) Loads the given data into this WebView using a 'data' scheme URL. |
void | loadDataWithBaseURL(@Nullable String baseUrl, String data, @Nullable String mimeType, @Nullable String encoding, @Nullable String historyUrl) Loads the given data into this WebView, using baseUrl as the base URL for the content. |
void | loadUrl(String url) Loads the given URL. |
void | loadUrl(String url, Map Loads the given URL with the specified additional HTTP headers. |
void | measure(int widthMeasureSpec, int heightMeasureSpec) This is called to find out how big a view should be. |
boolean | onTouchEvent(MotionEvent event) |
boolean | post(Runnable action) Causes the Runnable to be added to the message queue. |
void | postUrl(String url, byte[] postData) Loads the URL with postData using "POST" method into this WebView. |
void | reload() Reloads the current URL. |
void | removeAllViews() Call this method to remove all child views from the ViewGroup. |
void | removeJavascriptInterface(@NonNull String name) Removes a previously injected Java object from this WebView. |
boolean | requestFocus(int direction) Call this to try to give focus to a specific view or to one of its descendants and give it a hint about what direction focus is heading. |
void | requestFocusNodeHref(@Nullable Message hrefMsg) Requests the anchor or image element URL at the last tapped point. |
void | requestLayout() Call this when something has changed which has invalidated the layout of this view. |
WebBackForwardList | restoreState(Bundle inState) Restores the state of this WebView from the given Bundle. |
WebBackForwardList | saveState(Bundle outState) Saves the state of this WebView used in android.app.Activity#onSaveInstanceState . |
void | saveWebArchive(String filename) Saves the current view as a web archive. |
void | scrollTo(int x, int y) Set the scrolled position of your view. |
void | setBackgroundColor(int color) |
void | setClickable(boolean clickable) Enables or disables click events for this view. |
void | setDownloadListener(DownloadListener listener) Registers the interface to be used when content can not be handled by the rendering engine, and should be downloaded instead. |
void | setDrawingCacheEnabled(boolean enabled) Enables or disables the drawing cache. |
void | setEnabled(boolean enabled) Set the enabled state of this view. |
void | setFindListener(FindListener listener) Registers the listener to be notified as find-on-page operations progress. |
void | setFocusable(boolean focusable) Set whether this view can receive the focus. |
void | setFocusableInTouchMode(boolean focusableInTouchMode) Set whether this view can receive focus while in touch mode. |
void | setHorizontalScrollBarEnabled(boolean horizontalScrollBarEnabled) Define whether the horizontal scrollbar should be drawn or not. |
void | setHttpAuthUsernamePassword(String host, String realm, String username, String password) Stores HTTP authentication credentials for a given host and realm to the WebViewDatabase instance. |
void | setInitialScale(int scaleInPercent) Sets the initial scale for this WebView. |
void | setLayerType(int layerType, Paint paint) |
void | setLayoutParams(ViewGroup.LayoutParams params) |
void | setLongClickable(boolean longClickable) Enables or disables long click events for this view. |
void | setMinimumWidth(int minWidth) Sets the minimum width of the view. |
void | setNetworkAvailable(boolean networkUp) Informs WebView of the network state. |
void | setOnKeyListener(OnKeyListener l) Register a callback to be invoked when a hardware key is pressed in this view. |
void | setOnLongClickListener(@Nullable OnLongClickListener l) Register a callback to be invoked when this view is clicked and held. |
void | setOnTouchListener(OnTouchListener l) Register a callback to be invoked when a touch event is sent to this view. |
void | setOverScrollMode(int mode) |
void | setPadding(int left, int top, int right, int bottom) Sets the padding. |
void | setPictureListener(PictureListener listener) Sets the Picture listener. |
void | setScrollbarFadingEnabled(boolean fadeScrollbars) Define whether scrollbars will fade when the view is not scrolling. |
void | setScrollBarStyle(int style) |
void | setScrollContainer(boolean isScrollContainer) Change whether this view is one of the set of scrollable containers in its window. |
void | setSystemUiVisibility(int visibility) Request that the visibility of the status bar or other screen/window decorations be changed. |
void | setTag(final Object tag) Sets the tag associated with this view. |
void | setTag(int key, final Object tag) Sets a tag associated with this view and a key. |
void | setVerticalScrollBarEnabled(boolean verticalScrollBarEnabled) Define whether the vertical scrollbar should be drawn or not. |
void | setVisibility(@Visibility int visibility) Set the visibility state of this view. |
void | setWebChromeClient(WebChromeClient client) Sets the chrome handler. |
void | setWebContentsDebuggingEnabled(boolean enabled) Enables debugging of web contents (HTML / CSS / JavaScript) loaded into any WebViews of this application. |
void | setWebViewClient(WebViewClient client) Sets the WebViewClient that will receive various notifications and requests. |
void | setWillNotCacheDrawing(boolean willNotCacheDrawing) When a View's drawing cache is enabled, drawing is redirected to an offscreen bitmap. |
void | stopLoading() Stops the current load. |