Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
RestClient getResponse()适用于android 2.3,但不适用于4.0.4_Android_Web Services_Rest Client_Getresponse - Fatal编程技术网

RestClient getResponse()适用于android 2.3,但不适用于4.0.4

RestClient getResponse()适用于android 2.3,但不适用于4.0.4,android,web-services,rest-client,getresponse,Android,Web Services,Rest Client,Getresponse,我有这个代码,用于从web获取数据 String LOGIN_URL = "http://www.mywebsite.com/services/login.php"; RestClient client = new RestClient(LOGIN_URL ); client.AddParam("email", tbEmail.getText().toString()); client.AddPara

我有这个代码,用于从web获取数据

String LOGIN_URL = "http://www.mywebsite.com/services/login.php";
                RestClient client = new RestClient(LOGIN_URL );
                client.AddParam("email", tbEmail.getText().toString());
                client.AddParam("pwd", Password);
                client.Execute(RequestMethod.GET);
                String response = client.getResponse();

                JSONObject jo = new JSONObject(response);
在使用Android 2.3的emulator中工作正常,响应是我的数据,但当我在使用Android 4.0.4(CyanogenMod9)的手机上运行相同的代码时,响应是空的。
你能告诉我怎么了吗?

你的手机没有连接到互联网。

你有什么错误吗?请登录logcat并在此处发布。你有android.os.NetworkOnMainThreadException吗?非常感谢。。。。我重新安装了手机,却忘了设置DroidWall。你救了我:D谢谢。。。