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

Description
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();
}
}