我要检查404找不到网页从web视图,如果它是一个404,然后我恢复到 previous页面。泰对你有所帮助。
I want to check a "404 page not found" from a WebView and if it's a 404 then I revert to the previous page. Ty for your help
编辑也是我想看到的网页是纯.JPG 1.JPG 2.JPG 3.JPG,但我有一个如何存在许多图像没有资料。因此,如果任何人都可以提出另一种方法,欢迎他这样做。
EDIT also the webpages I want to see are pure .jpg 1.jpg 2.jpg 3.jpg but I have no info of how many images exist. So if anyone can propose another method, he is welcome to do so.
附加 WebViewClient
您的WebView
,在这里您可以覆盖 onReceivedError()
来了解404的响应 - 尽管这可能会被返回 ERROR_FILE_NOT_FOUND
。
Attach a WebViewClient
to your WebView
, where you override onReceivedError()
to find out about the 404 response -- though that will probably be returned as ERROR_FILE_NOT_FOUND
.
上一篇:除了正确处理:" getParameters失败(空参数)"正确处理、参数、QUOT、getParameters
下一篇:为什么我们用10.0.2.2连接,而不是在Android客户端使用的计算机的IP地址,本地Web服务器是在、而不、客户端、地址