0

There is some method to identify in a webview, if the user clicks link 1 or link 2, and do something about it, for example within the webview if the user goes to page 2 show an image, or if you go to link 3 display this page and the application displays a text, in short, detect in which page the user is located within the webview and make an action about it, any ideas and/or examples of this type of activities? Really would appreciate your help.

JLouis
  • 284
  • 1
  • 5
  • 18

1 Answers1

1

Get the link of the current page, so that you can perform the action

wbView.setWebViewClient(new MyWebViewClient());
       wbView.loadUrl("Url");

private class MyWebViewClient extends WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url)
        {
            Log.v("uuuurl",url);
            view.loadUrl(url);
            return true;
        }
    }  
Abhi
  • 8,935
  • 7
  • 37
  • 60
  • Yes, i'm doing it, but i want to identificate, if of the page 1 goes to page two or three through a link, and do a different action as the case to go to link 2 or 3. – JLouis Mar 13 '12 at 03:19