WebViewAssetLoader.AssetsPathHandler

public static final class WebViewAssetLoader.AssetsPathHandler
extends Object implements WebViewAssetLoader.PathHandler

java.lang.Object
   ↳ androidx.webkit.WebViewAssetLoader.AssetsPathHandler


Handler class to open a file from assets directory in the application APK.

Summary

Public constructors

AssetsPathHandler(Context context)

Public methods

WebResourceResponse handle(String path)

Opens the requested file from the application's assets directory.

Inherited methods

Public constructors

AssetsPathHandler

public AssetsPathHandler (Context context)

Parameters
context Context: Context used to resolve assets.

Public methods

handle

public WebResourceResponse handle (String path)

Opens the requested file from the application's assets directory.

The matched prefix path used shouldn't be a prefix of a real web path. Thus, if the requested file cannot be found a WebResourceResponse object with a null InputStream will be returned instead of