Android: cannot load specific site in webView -
webview opens site except one.
http://www.ynet.co.il/home/0,7340,l-8,00.html
edit: after checking ddms javabinder exception of !!! failed binder transaction !!!
the code webview activity:
public class webactivity extends activity { webview wv; final activity activity = this; @suppresslint("setjavascriptenabled") @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); this.getwindow().requestfeature(window.feature_progress); setprogressbarindeterminatevisibility(true); setcontentview(r.layout.activity_web); wv = (webview)findviewbyid(r.id.webview1); intent intent = getintent(); final string url = intent.getstringextra("url"); log.i("webview", url); wv.getsettings().setjavascriptenabled(true); wv.getsettings().setbuiltinzoomcontrols(true); wv.getsettings().setloadwithoverviewmode(true); wv.getsettings().setusewideviewport(true); wv.setwebchromeclient(new webchromeclient() { public void onprogresschanged(webview view, int progress) { activity.settitle("loading..."); activity.setprogress(progress * 100); if(progress == 100) activity.settitle(r.string.app_name); } }); wv.setwebviewclient(new webviewclient() { @override public boolean shouldoverrideurlloading(webview view, string url) { view.loadurl(url); return true; } }); wv.loadurl(url); }
any thoughts?
i think website tranforming url http://m.ynet.co.il/main.aspx this url.
remove code if not compulsary.
wv.setwebchromeclient(new webchromeclient() { public void onprogresschanged(webview view, int progress) { activity.settitle("loading..."); activity.setprogress(progress * 100); if(progress == 100) activity.settitle(r.string.app_name); } }); wv.setwebviewclient(new webviewclient() { @override public boolean shouldoverrideurlloading(webview view, string url) { view.loadurl(url); return true; } });
my code same is
webview wv; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); wv = (webview)findviewbyid(r.id.webview1); wv.getsettings().setjavascriptenabled(true); wv.getsettings().setbuiltinzoomcontrols(true); wv.getsettings().setloadwithoverviewmode(true); wv.getsettings().setusewideviewport(true); wv.loadurl("http://www.ynet.co.il/home/0,7340,l-8,00.html"); }
try use directly
Comments
Post a Comment