android async http - 连接到不同的端口

时间:2014-01-17 12:05:42

标签: android http

我正在使用loopj android-async-http。

我有问题让这个工作。我想连接到8081,但此代码不起作用:

AsyncHttpClient client = new AsyncHttpClient(8081);
...
client.post("http://10.0.2.2:8081/mysite/my_api.php",params, new JsonHttpResponseHandler() {
...

错误我得到了:

java.io.IOException: Unhandled exception: Host name may not be null

0 个答案:

没有答案
相关问题