您的位置:首页 > 编程语言 > Java开发

java.net.UnknownHostException: Unable to resolve host "xxx": No address associated with hostname

2015-08-25 20:49 1116 查看
I encountered this problem too, reconnecting the WiFi can solve this.

For us ,we can check if the phone can resolve the host to IP when we start application. If it cannot resolve, tell the user to check the WiFi and then exit.

I hope it helps.

在调试的时候发生如下错误:

java.net.UnknownHostException: Unable to resolve host "xxx": No address associated with hostname

原因是从wifi状态下,切换到没有网络的环境下,然后出现了上述的错误。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: