[英]Accessing Earthquake API in Android. UnknownHostException
我只是尝试访问Earthquake API,并且遇到此错误。
03-22 00:55:27.805: W/System.err(1044): java.net.UnknownHostException: Unable to resolve host "earthquake.usgs.gov": No address associated with hostname 03-22 00:55:27.815: W/System.err(1044): at java.net.InetAddress.lookupHostByName(InetAddress.java:426) 03-22 00:55:27.815: W/System.err(1044): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:242) 03-22 00:55:27.815: W/System.err(1044): at java.net.InetAddress.getAllByName(InetAddress.java:220)
Have you given your application the INTERNET
permission in its AndroidManifest.xml file? 您是否已在其AndroidManifest.xml文件中为应用程序授予了
INTERNET
权限 ?
You should have a line like the following in there: 您应该在其中输入以下内容:
<uses-permission android:name="android.permission.INTERNET"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.