android - Trying to implement WebviewClient..but failing -
i saw several articles here implementing webviewclient transitions in webview stay in webview rather go browser. when try run application webview loads still doesnt correct page transition problem. possible need replace "shouldoveride" "on create"?
public class webviewactivity extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); webview wv = (webview) findviewbyid(r.id.webview1); websettings websettings = wv.getsettings(); websettings.setbuiltinzoomcontrols(true); wv.loadurl("http://www.yahoo.com"); } private class callback extends webviewclient { @override public boolean shouldoverrideurlloading(webview view, string url) { return(true); } }
}
if want show pages inside webview
instead of openning in default browser, need speficy webviewclient
. it's not necessary create custom class extends webviewclient
wv.setwebviewclient(new webviewclient());
Comments
Post a Comment