GET HTTP状态code Android中的WebView [英] Get Http Status Code in Android WebView

查看:2008
本文介绍了GET HTTP状态code Android中的WebView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序,它加载网站的web视图,但有时该网站收益以http code 500。

i'm developing an android app that it load a website in a webview, but sometimes the website return with Http code 500.

我的问题是....有什么办法让从web视图HTTP状态code用监听器或其他类??

My question is.... There is any way to get the http status code from a webview with a listener or with another class??

我想实现一个WebViewClient,但我无法得到它收到的WebView HTTP状态code。

I tried to implement an WebViewClient, but i couldn't get the http status code which webview received.

感谢所有。

推荐答案

这是不可能的(由于我写这​​篇的时间)。该文档的 onReceiveError()暧昧充其量不过是你看待这个问题,

It's not possible (as of the time i'm writing this). The docs for onReceiveError() are ambiguous at best, but it you look at this issue,

HTTP://$c$c.google。 COM / P /安卓/问题/详细信息?ID = 968

很明显,HTTP状态codeS将无法通过该机制的报道。它是如何有可能是开发商写了的WebView 有没有办法来检索HTTP状态code真的吹拂我的心灵。

It's clear that HTTP status codes won't be reported through that mechanism. How it's possible that the developers wrote WebView with no way to retrieve the HTTP status code really blows my mind.

这篇关于GET HTTP状态code Android中的WebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆