错误日志如上:
01-07 03:05:16.096: WARN/System.err(31479): Caused by: java.net.UnknownHostException: Host is unresolved: api.t.sina.com.cn:80
01-07 03:05:16.106: WARN/System.err(31479): at java.net.Socket.connect(Socket.java:1037)
01-07 03:05:16.116: WARN/System.err(31479): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)
01-07 03:05:16.116: WARN/System.err(31479): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:129)
01-07 03:05:16.116: WARN/System.err(31479): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
01-07 03:05:16.116: WARN/System.err(31479): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
01-07 03:05:16.116: WARN/System.err(31479): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
01-07 03:05:16.116: WARN/System.err(31479): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
01-07 03:05:16.126: WARN/System.err(31479): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
01-07 03:05:16.126: WARN/System.err(31479): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
01-07 03:05:16.126: WARN/System.err(31479): at oauth.signpost.commonshttp.CommonsHttpOAuthProvider.sendRequest(CommonsHttpOAuthProvider.java:64)
01-07 03:05:16.126: WARN/System.err(31479): at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:177)
01-07 03:05:16.136: WARN/System.err(31479): ... 24 more
看了【水的右边】的博客:http://www.cnblogs.com/hll2008/archive/2011/01/03/1924952.html
现在想实现Add功能。当点击Add按钮时跳转到验证页面,但是点击授权后就提示上述错误。
网上查了下,都是是模拟器的问题.,但不清楚如何解决的。。
网上流传的其它解决办法,不懂具体原因,我的模拟器能上网啊,而且第一个用户授权也没问题。
解决办法很简单,就是Android能上网即可。
注意:此异常是人人网的异常"api.renren.com:80","renren"也可能是别的开放api