I am using the following code to hide the webview if a url ends with a particular string.
webview.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
if (url.endsWith("index.asp")) {
Toast.makeText(getActivity().getApplicationContext(),"Login successfull",Toast.LENGTH_LONG).show();
webview.setVisibility(view.GONE);
}
}
});
but the webview still remains if the url ends with index.asp( for example "http://abc.def/index.asp")