Reputation: 109
I have a webview and webview has contain a URL..I want to click to URL ,an alert dialog notification will display. My idea is: when click that URL,the web browser default will load that URL to go to webpage..I will get URL in web browser and compares..If true,it will display alert dialog ,unless it not display. But I don't know get URL in web browser default.How must I do??
Upvotes: 0
Views: 640
Reputation: 171
You can obtain the url loaded in a webview whit:
webview.getUrl();
also you can override onProgressChanged Method and take action when a page finishes loading
webview.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int progress){
if(progress == 100){
// Takes the actions
}
}
});
Upvotes: 3