Android Webview shouldOverrideUrlLoading method -


when shouldoverrideurlloading method called?

webview.setwebviewclient(new webviewclient(){     @override     public boolean shouldoverrideurlloading(webview view, string url) {       } }); 
  1. is called during initial loading of url? e.g. webview.loadurl( "file:///android_asset/html/index.html");
  2. is called everytime url of webview changes?

any reference? didn't find one. thanks

  1. it however, called when webview load different url 1 user had requested.

  2. calling loadurl() trigger shouldoverrideurlloading() method. (only when new url loaded.)

give host application chance take on control when new url loaded in current webview. if webviewclient not provided, default webview ask activity manager choose proper handler url. if webviewclient provided, return true means host application handles url, while return false means current webview handles url.

ref : public boolean shouldoverrideurlloading (webview view, string url)


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -