try {
InetAddress i = InetAddress.getByName("http://www.google.com");
Log.e("InetAddress", "InetAddress");
} catch (UnknownHostException e1) {
e1.printStackTrace();
}
它提供unknownHostException
。这是应用程序与服务器唯一的关系。为什么会发生这种情况,我该如何解决?
答案 0 :(得分:1)
您是否为设备设置了使用互联网的权限?
What permission do I need to access Internet from an android application?