Answer the question
In order to leave comments, you need to log in
WebView determine what to open url in new window?
I have a simple webview application. Is there any way in the WebChromeClient or WebClient instance to determine that the page needs to be opened in a new window? (for example, a new window needs to be opened, in case of clicking on a link like: a target="_blank" href="...")
mWebView = new WebView(activity);
mWebView.setWebChromeClient(new WebChromeClient() {...});
mWebView.setWebViewClient(new WebClient() {...});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
mWebView.getSettings().setAllowUniversalAccessFromFileURLs(true);
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setSupportMultipleWindows(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
mWebView.getSettings().setAllowUniversalAccessFromFileURLs(true);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question