RestClient getResponse()适用于android 2.3,但不适用于4.0.4
我有这个代码,用于从web获取数据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
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谢谢。。。