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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -