title: android App crashes (http GET)
body: <p>my app always crashes wehen I run the get function and I find no solution:</p>
  
  <pre><code>07-09 12:49:45.613: E/AndroidRuntime(1395): FATAL EXCEPTION: main
  07-09 12:49:45.613: E/AndroidRuntime(1395): java.lang.IllegalStateException: Could not execute method of the activity
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at android.view.View$1.onClick(View.java:3724)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at android.view.View.performClick(View.java:4261)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at android.view.View$PerformClick.run(View.java:17356)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at android.os.Handler.handleCallback(Handler.java:615)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at android.os.Handler.dispatchMessage(Handler.java:92)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at android.os.Looper.loop(Looper.java:137)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at android.app.ActivityThread.main(ActivityThread.java:4921)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at java.lang.reflect.Method.invoke(Method.java:511)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at dalvik.system.NativeStart.main(Native Method)
  07-09 12:49:45.613: E/AndroidRuntime(1395): Caused by: java.lang.reflect.InvocationTargetException
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at java.lang.reflect.Method.invoke(Method.java:511)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at android.view.View$1.onClick(View.java:3719)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     ... 11 more
  07-09 12:49:45.613: E/AndroidRuntime(1395): Caused by: android.os.NetworkOnMainThreadException
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1118)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at java.net.InetAddress.getAllByName(InetAddress.java:214)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:670)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:509)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at de.xx.XX.postData(xx.java:315)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     at de.xx.XX.send_msg(xx.java:301)
  07-09 12:49:45.613: E/AndroidRuntime(1395):     ... 14 more
  </code></pre>
  
  <p>My http get Android Java  Code:</p>
  
  <pre><code>public void postData() {
  
          HttpClient client = new DefaultHttpClient();
          HttpGet request = new HttpGet("http://www.xxxx.com/mobile/xxx/save.php?text=sdf"); 
  
          // replace with your url
          HttpResponse response;
          try {
              response = client.execute(request);
  
              Log.d("Response of GET request", response.toString());
          } catch (ClientProtocolException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
      } 
  </code></pre>
  
  <p>I hope you can help me and I apologize for my bad english. Why do we have to write as much text here, I do not know what to write.</p>