networking - Avoid showing my URL in a webview Android application -
i need effective way not show url of page example when disable network connections , click on 'link' in application. i'm doing check before starting application, , when click button action bar redirects me home page, when example browsing @ application inside webview, , disable wifi , 3g connections, , click on something, webview returns me error connection: "web page not available", , shows url. can not let happen in application, knows how check connection in 'page load' application do?
you can make custom html , put in asset folder. ,
mwebview.setwebviewclient(new webviewclient(){ @override public boolean shouldoverrideurlloading(webview view, string url) { logger.d("url", url); // if(url.contains(".") && !url.startswith("http://docs.google.com") && !url.startswith("https://docs.google.com") && docsupported.contains(url.substring(url.lastindexof(".") + 1).tolowercase())){ // openurl(url); // }else // super.shouldoverrideurlloading(mwebview, url); if(utils.isnetworkavailable(getactivity().getapplicationcontext())) mwebview.loadurl(url); else mwebview.loadurl("file:///android_asset/errorpage.html"); selectedimagefile = null; return true; }} that it.
you can in onerror method of webchromeclient not working in os versons.
Comments
Post a Comment