Skip to content

Article reader spinner stays on forever when the article fails to load #197

Description

@jim-daf

Summary

HNReaderWebViewClient in app/src/main/java/com/manuelmaly/hn/ArticleReaderActivity.java toggles the article reader's swipe-refresh spinner from onPageStarted (turn on) and onPageFinished (turn off). It does not override onReceivedError. When the WebView fails to load an article (no network, DNS, TLS, server timeout, whatever), Android calls onReceivedError without calling onPageFinished, so the spinner stays on forever and the activity looks frozen until the user backs out.

The reader is the main destination from the front page, so this is the most likely place a user hits it.

Proposal

Add a minimal onReceivedError(view, errorCode, description, failingUrl) override that calls the same teardown as onPageFinished. setShowRefreshing(false) and mWebViewIsLoading = false. Log the error so the failure is visible in logcat for diagnosis. No new UI surface, no new strings, no change to the happy path.

The deprecated 4-arg signature is used on purpose because the app's minimum SDK is below 23 and that signature is the one the framework dispatches on every supported API level.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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