Skip to content

Something wrong in the Webview's navigation #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ShengjieGeng opened this issue Mar 7, 2025 · 0 comments
Open

Something wrong in the Webview's navigation #268

ShengjieGeng opened this issue Mar 7, 2025 · 0 comments

Comments

@ShengjieGeng
Copy link

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();
        }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant