Saturday, 15 March 2014

android - Why am I getting "WebPage not available" when running my web app? -



android - Why am I getting "WebPage not available" when running my web app? -

why happening?

public class mainactivity extends activity { webview browser; @override public void oncreate(bundle icicle) { super.oncreate(icicle); setcontentview(r.layout.activity_main); //browser.getsettings().setjavascriptenabled(true); browser = (webview)findviewbyid(r.id.webkit); browser.loadurl("www.microsoft.com"); } }

but when run android html5 app screen goo.gl/udkj1

i tried other possibilities such http:// in front end or end address slash , on.

make sure have net permission set in androidmanifest.xml:

<uses-permission android:name="android.permission.internet" />

edit:

browser.setwebviewclient(new webviewclient() { @override public boolean shouldoverrideurlloading(webview view, string url) { view.loadurl(url); homecoming true; } });

android

No comments:

Post a Comment