title: HttpResponse response = client.execute(httpGet), the code after httpresponse doesn't run
body: <p>I've try to get data from my web <code>/http://localhost/android_connection/getHttpGet.php</code> which follow the code from this site,<a href="http://www.thaicreate.com/mobile/android-httpget-httppost.html" rel="nofollow">http://www.thaicreate.com/mobile/android-httpget-httppost.html</a>. </p>
  
  <p>The result of "<code>/http://localhost/android_connection/getHttpGet.php</code>" just after following this line :</p>
  
  <pre><code>Server Date/Time : 2014-06-04 04:28:49
  </code></pre>
  
  <p>I'm using Xampp for my localhost.</p>
  
  <p>In android programming
  the code after >> HttpResponse response = client.execute(httpGet) doesn't run by catching log.e. Log.e("error1.1","Before try"); and Log.e("error1.2","Before HttpResponse"); only appear on my LogCat. </p>
  
  <p>I don't know how to fix plz help me, by the way i'm a beginner in programming of using webserver via android application.</p>
  
  <pre><code>public class MainActivity extends Activity {
  
      @SuppressLint("NewApi")
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          // Permission StrictMode
  
  
          if (android.os.Build.VERSION.SDK_INT &gt; 9) {
              StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
              StrictMode.setThreadPolicy(policy);
          }
  
          final TextView result = (TextView) findViewById(R.id.result);
          final Button btnGet = (Button) findViewById(R.id.btnGet);
  
          btnGet.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
                  // TODO Auto-generated method stub
                  String url = "http://localhost/android_connection/getHttpGet.php";
                  String resultServer  = getHttpGet(url);
                  result.setText(resultServer);
              }
          });
      }
  
      public String getHttpGet(String url) {
  
          StringBuilder str = new StringBuilder();
          HttpClient client = new DefaultHttpClient();
          HttpGet httpGet = new HttpGet(url);
          Log.e("error1.1","Before try");
          try {
              Log.e("error1.2", "Before HttpResponse");
              HttpResponse response = client.execute(httpGet);
              Log.e("error1.3", "End of HttpResponse");
              StatusLine statusline = response.getStatusLine();
              int statusCode = statusline.getStatusCode();
              if (statusCode == 200) { // Status OK
                  HttpEntity entity = response.getEntity();
                  InputStream content = entity.getContent();
                  BufferedReader reader = new BufferedReader(new InputStreamReader(content));
                  String line;
                  while ((line = reader.readLine()) != null) {
                      str.append(line);
                      Log.e("error2","line : " + line);
                  }
              }
  
  
          } catch (ClientProtocolException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          return str.toString();
      }
  }
  </code></pre>