I'm about to roll out an app for my cricket team where we can view or match videos... However, there are some ads in the webview, if clicked on the ad, it loads in that same webview so the video is lost. How can I implement a code that opens the ad in the android browser instead of app webview??
.java File
WebView displayVideo = findViewById(R.id.webView); displayVideo.setWebViewClient(new WebViewClient() {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon){
super.onPageStarted(view, url, favicon);
progressBar.setVisibility(View.VISIBLE);
setTitle("Loading...");
}
@Override
public void onPageFinished(WebView view, String url){
super.onPageFinished(view, url);
progressBar.setVisibility(View.GONE);
setTitle(view.getTitle());
view.loadUrl("javascript:onPageFinished();");
}
});
WebSettings webSettings = displayVideo.getSettings();
webSettings.setJavaScriptEnabled(true);
displayVideo.loadData(frameVideo, "text/html", "utf-8");
webSettings.setMediaPlaybackRequiresUserGesture(false);
}