Question : andorid studio webview app lik click new tab open stop
Answered by : habibur-rahman-qay4apajp5dq
@Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String url ="http://dirtywasted.com/"; WebView view=(WebView) this.findViewById(R.id.webView); view.getSettings().setJavaScriptEnabled(true); view.setWebViewClient(new WebViewClient() { @Override public bool shouldOverrideUrlLoading(WebView view, String url) { //url will be the url that you click in your webview. //you can open it with your own webview or do //whatever you want //Here is the example that you open it your own webview. view.loadUrl(url); return true; } }); view.loadUrl(url);
}
Source : https://stackoverflow.com/questions/29023299/webview-stop-from-opening-links-in-browser-and-keep-in-app | Last Update : Mon, 13 Sep 21