This commit is contained in:
M66B 2021-05-14 12:10:25 +02:00
parent e8d03cbb1a
commit 332a7684b4
1 changed files with 2 additions and 5 deletions

View File

@ -369,11 +369,8 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
return getGenericUserAgent(context);
try {
if (userAgent == null) {
if (webView == null)
webView = new WebView(context);
userAgent = webView.getSettings().getUserAgentString();
}
if (userAgent == null)
userAgent = WebSettings.getDefaultUserAgent(context);
return userAgent;
} catch (Throwable ex) {
Log.w(ex);