public final class

WebViewAssetLoader.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.webkit.WebViewAssetLoader.Builder

Overview

A builder class for constructing WebViewAssetLoader objects.

Summary

Constructors
publicBuilder()

Methods
public WebViewAssetLoader.BuilderaddPathHandler(java.lang.String path, WebViewAssetLoader.PathHandler handler)

Register a WebViewAssetLoader.PathHandler for a specific path.

public WebViewAssetLoaderbuild()

Build and return a WebViewAssetLoader object.

public WebViewAssetLoader.BuildersetDomain(java.lang.String domain)

Set the domain under which app assets can be accessed.

public WebViewAssetLoader.BuildersetHttpAllowed(boolean httpAllowed)

Allow using the HTTP scheme in addition to HTTPS.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Methods

public WebViewAssetLoader.Builder setDomain(java.lang.String domain)

Set the domain under which app assets can be accessed. The default domain is "appassets.androidplatform.net"

Parameters:

domain: the domain on which app assets should be hosted.

Returns:

WebViewAssetLoader.Builder object.

public WebViewAssetLoader.Builder setHttpAllowed(boolean httpAllowed)

Allow using the HTTP scheme in addition to HTTPS. The default is to not allow HTTP.

Returns:

WebViewAssetLoader.Builder object.

public WebViewAssetLoader.Builder addPathHandler(java.lang.String path, WebViewAssetLoader.PathHandler handler)

Register a WebViewAssetLoader.PathHandler for a specific path.

The path should start and end with a "/" and it shouldn't collide with a real web path.

WebViewAssetLoader will try PathHandlers in the order they're registered, and will use whichever is the first to return a non-null .

Parameters:

path: the prefix path where this handler should be register.
handler: WebViewAssetLoader.PathHandler that handles requests for this path.

Returns:

WebViewAssetLoader.Builder object.

public WebViewAssetLoader build()

Build and return a WebViewAssetLoader object.

Returns:

immutable WebViewAssetLoader object.