Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Something wrong in the Webview's navigation #268

Description

@ShengjieGeng

Hi, I'm using the Webview in my App, I added the useragent in the websettings, but the second page can not goback to the first page using webview.goback().
By the way, it gose well with no customizing useragent.
As the codes showing below:

String userAgentString = webSettings.getUserAgentString();
webSettings.setUserAgentString(userAgentString.concat(myAgent));
webSettings.setJavaScriptEnabled(true);
webSettings.setAllowUniversalAccessFromFileURLs(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setDomStorageEnabled(true);
@Override
public void onBackPressed() {
        if (!webview.canGoBack()) {
            super.onBackPressed();
        }else{
           webview.back();
        }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions