开发者

Internal links in WebView

开发者 https://www.devze.com 2022-12-24 23:28 出处:网络
I want to find out when a user clicks an internal link in a url currently opened 开发者_开发问答in webview. How can I do that?

I want to find out when a user clicks an internal link in a url currently opened 开发者_开发问答in webview. How can I do that?

Thanks, Farha


Try setting WebViewClient for the WebView and the onPageStarted() method will be called when the page loading is started.

Edit: To be more clear, this may be a sample code:

WebView wview = (WebView) findViewById(R.id.webView1);
WebViewClient wvClient = new WebViewClient();
wview.setWebViewClient(wvClient);
wvClient.onPageStarted(wview, wview.getUrl(), null);
0

精彩评论

暂无评论...
验证码 换一张
取 消