0

I have this code for get data from 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);

And in emulator with Android 2.3 work fine and in response are my data, but when I run this same code on my phone with Android 4.0.4 (CyanogenMod9), in response are null. Can you please tell me what is wrong?

spajdo
  • 901
  • 9
  • 20
  • Have you got any error ? Please check in logcat and post here . Have you got android.os.NetworkOnMainThreadException ? – Chirag Aug 21 '12 at 06:46

1 Answers1

0

Your phone is not connected to the internet.

josephus
  • 8,284
  • 1
  • 37
  • 57
  • Thank you very much.... I reinstall my phone and I forget set DroidWall. You save me :D Thanks... – spajdo Aug 21 '12 at 09:13