Reputation: 37579
I want to load a remote url that haves an ad. The ad will use JavaScript.
I am using:
webview.loadUrl("http://myurl.com")
webview.getSettings().setJavaScriptEnabled(true);
Which differences will exists if I use:
webview.loadDataWithBaseURL("http://myurl.com", null, null, null, null)
webview.getSettings().setJavaScriptEnabled(true);
Thanks
Upvotes: 3
Views: 5351
Reputation: 3723
LoadDataWithBaseURL() - Loads the given data into this WebView, using baseUrl as the base URL for the content. The base URL is used both to resolve relative URLs and when applying JavaScript's same origin policy. The historyUrl is used for the history entry. ....
LoadUrl() - Loads the given URL with the specified additional HTTP headers.
See documentation - http://developer.android.com/reference/android/webkit/WebView.html
Upvotes: 1