3

In my application I need to detect the link click inside the webview. I use the following code

web = (WebView)findViewById(R.id.webView1);
        web.getSettings().setJavaScriptEnabled(true);
        web.setWebViewClient(new VideoWebViewClient());

        web.loadUrl("http://syncquik.com/home.php");

class VideoWebViewClient extends WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {

            System.out.println("link===="+url);
            view.loadUrl(url);

            return false;
        }

But shouldOverrideUrlLoading(WebView view, String url) method is not called when web.getSettings().setJavaScriptEnabled(true); is written. But if I don't write web.getSettings().setJavaScriptEnabled(true); then shouldOverrideUrlLoading(WebView view, String url) is called and link is detected. I need both of this two, need to enable javascript and detect the link click. Please help me to figure out this. Santanu

Santanu
  • 141
  • 2
  • 11

1 Answers1

0

It works on my project, maybe you should try to clean your project and try again by Project --> Clean