Skip to content

Loading spinner gets stuck if a WebView load fails #555

@jim-daf

Description

@jim-daf

The three WebView clients in the app all show a loading spinner that is hidden from inside onPageFinished (directly or via the onLoaded callback). None of them override onReceivedError, so a main-frame load failure leaves the spinner spinning indefinitely.

The affected files:

The documentation viewer is the most reachable case in practice, because it is configured with:

cacheMode = WebSettings.LOAD_CACHE_ELSE_NETWORK
blockNetworkLoads = true

So a cache miss for the bundled documentation (or any error reading the cached entry) cannot fall back to network. The user is stuck on the spinner with no way to know what happened.

Suggested fix: add onReceivedError(view, request, error) on each of the three WebViewClients and call hideLoading() / onLoaded() for request.isForMainFrame only. Sub-resource errors are still ignored so the spinner does not race off on transient asset failures. PR at #556.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions