这code不工作:
URL url = new URL( xmlPath );
InputSource input = new InputSource( url.openStream() );
所有的时间,导致一个UnknownHostException,即使主机的存在,一直使用相同的code。如果从不同的开发主机(机),并且还从浏览器中点击成功。
all the time, resulting in an UnknownHostException, even when the host exists, has been hit successfully using the same code if from a different development host (machine), and also from a browser.
我可能脱节再次问这个问题时,http://stackoverflow.com/questions/3293659/android-java-net-unknownhostexception-host-is-unresolved-strategy-question.论坛软件也不会允许我对不满意的回答这个问题发表意见(以招揽更多地关注解决方案,我最终找到)。也许我没有足够的人气尚未给予的特权。在此期间,我基本上是重新发布的问题和不同的答案。
I'm probably out of line asking this question again, a repeat of http://stackoverflow.com/questions/3293659/android-java-net-unknownhostexception-host-is-unresolved-strategy-question. The forum software would not allow me to comment on the unsatisfactory answer to that question (in order to solicit more attention to the solution I ultimately found). Perhaps I'm not popular enough yet to be given that privilege. In the meantime, I'm essentially re-posting the question and a different answer.
基本上,我同意,也许在Android设备也很难用在某些情况下DNS,但我试过,例如如何使用SAX解析器anddev.org例子,和它的工作在一台机器我有和没有其他。
Basically, I accept that maybe the Android device has a hard time with DNS under certain circumstances, but I've tried, for example the anddev.org example of how to use the SAX parser, and it worked on one machine I have and not on another.
编辑: 如前所述,我知道工作的答案,将发布它。
As noted, I know a working answer and will post it.
我是)问一个问题(这已经被问和回答失败)和b)回答它那些人的利益,我的回答将是有益的。
I am a) asking a question (that's already been asked and unsuccessfully answered) and b) answering it for the benefit of those for whom my answer will be useful.
推荐答案
答案相当简单:删除,然后重新创建AVD(虚拟设备/仿真器)在Eclipse。它的工作对我来说 - 第一次
The answer is devilishly simple: remove, then re-create your AVD (virtual device/emulator) in Eclipse. It worked for me--first time.
相关推荐
最新文章