android - WebViewClient: load web pages with no header -
i'm using webviewclient open site in android application. when loads site shows this:
i "cut" page header, mean page starts point. should loaded this:
do know way this? (the website want load in app not mine)
here webviewclient in android app code:
public class mywebview extends fragment { private webview webview; public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); bundle args = getarguments(); string url = args.getstring("url"); webview = (webview) getview().findviewbyid(r.id.webview); webview.setwebviewclient(new mybrowser()); websettings websettings = webview.getsettings(); websettings.setsaveformdata(true); websettings.setusewideviewport(true); websettings.setloadwithoverviewmode(true); websettings.setsupportzoom(true); websettings.setloadsimagesautomatically(true); websettings.setjavascriptenabled(true); webview.setscrollbarstyle(view.scrollbars_inside_overlay); webview.loadurl(url); } public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.web_view, container, false); return view; } private class mybrowser extends webviewclient { final progressbar progressbar = (progressbar) getview().findviewbyid(r.id.progressbar); public boolean shouldoverrideurlloading(webview view, string url) { view.loadurl(url); return true; } public void onpagestarted(webview view, string url, bitmap favicon) { progressbar.setvisibility(view.visible); } public void onreceivederror(webview view, int errorcode, string description, string failingurl) { } public void onpagefinished(webview view, string url) { progressbar.setvisibility(view.gone); } } public void onbackpressed() { if (webview.cangoback()) webview.goback(); else getactivity().finish(); } }
thank in advance , sorry english.
Comments
Post a Comment