I have searched and read a lot of posts but can not figure out how to do it in my code. I want to use geolocation in my app and need to view in webChromeClient in stead of webViewClient wich I use...
original source :Â http://stackoverflow.com/questions/14664363/webchromeclient-opens-link-in-browser
WebChromeClient doesn't contain the shouldOverrideUrlLoading method, the WebViewClient does. Remember the "WebView" can and does use both WebViewClient and WebChromeClient at the same time if specified. The WebViewClient adds methods not available to you with no client assigned (keeping navigation in the webview). The same with the WebChromeClient has specific methods it can use (get page title on load for example).
So you can build your code like this:
WebView web = (WebView)findViewById(R.id.web); WebSettings webSettings = web.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setGeolocationEnabled(true); webSettings.setSupportMultipleWindows(true); // This forces ChromeClient enabled.   web.setWebChromeClient(new WebChromeClient(){   @Override   public void onReceivedTitle(WebView view, String title) {     getWindow().setTitle(title); //Set Activity tile to page title.   } }); web.setWebViewClient(new WebViewClient() {   @Override   public boolean shouldOverrideUrlLoading(WebView view, String url) {     view.loadUrl(url);     return false;   } });












