I’m including a mobile google advert in a webview (in a fragment). When you click the ad I wanted to open in new browser. I’ve enabled the following:
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
The google.js is generating a iFrame with however clicking the webview doesn’t seem to register as a new link click and doesn’t call shouldOverrideUrlLoading
Found the answer in another so question here,
However I’ve modified it to work for a fragment (included getActivity()). Note this is specifically for google ads. In you webclient overide the following method.