public void onLoadResource(WebView view, String url) 里是可以捕捉到要下载的资源,比如图片.
但似乎改变参数url的值,并不能改变WebView的行为,它仍然去加载未改变之前的url的资源。
我在想,是因为传来的这个参数只是一个引用,即使我改变了它(url="file:///sdcard/test.jpg"),但并没有改变实际的值?这是个什么原理?
API上说,这个url是WebView 即将要加载的的资源的地址啊!
public void onLoadResource (WebView view, String url)
Since: API Level 1
Notify the host application that the WebView will load the resource specified by the given url.
Parameters
view The WebView that is initiating the callback.
url The url of the resource the WebView will load. 可是无论我怎么传 网页内容都不会因此而改变