I am inserting the data from android to mysql using php and json request. When the event fire it gives the exception in the logcat. I am sharing my clogcat with you so you can have better look and idea of what is going on , here is my logcat :
10-07 03:55:13.073: E/AndroidRuntime(1665): FATAL EXCEPTION: main 10-07 03:55:13.073: E/AndroidRuntime(1665): android.os.NetworkOnMainThreadException 10-07 03:55:13.073: E/AndroidRuntime(1665): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1133) 10-07 03:55:13.073: E/AndroidRuntime(1665): at java.net.InetAddress.lookupHostByName(InetAddress.java:385) 10-07 03:55:13.073: E/AndroidRuntime(1665): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236) 10-07 03:55:13.073: E/AndroidRuntime(1665): at java.net.InetAddress.getAllByName(InetAddress.java:214) 10-07 03:55:13.073: E/AndroidRuntime(1665): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137) 10-07 03:55:13.073: E/AndroidRuntime(1665): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) 10-07 03:55:13.073: E/AndroidRuntime(1665): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) 10-07 03:55:13.073: E/AndroidRuntime(1665): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360) 10-07 03:55:13.073: E/AndroidRuntime(1665): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) 10-07 03:55:13.073: E/AndroidRuntime(1665): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) 10-07 03:55:13.073: E/AndroidRuntime(1665): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) 10-07 03:55:13.073: E/AndroidRuntime(1665): at com.example.receiptorganizer.Registration$1.insert(Registration.java:78) 10-07 03:55:13.073: E/AndroidRuntime(1665): at com.example.receiptorganizer.Registration$1.onClick(Registration.java:58) 10-07 03:55:13.073: E/AndroidRuntime(1665): at android.view.View.performClick(View.java:4240) 10-07 03:55:13.073: E/AndroidRuntime(1665): at android.view.View$PerformClick.run(View.java:17721) 10-07 03:55:13.073: E/AndroidRuntime(1665): at android.os.Handler.handleCallback(Handler.java:730) 10-07 03:55:13.073: E/AndroidRuntime(1665): at android.os.Handler.dispatchMessage(Handler.java:92) 10-07 03:55:13.073: E/AndroidRuntime(1665): at android.os.Looper.loop(Looper.java:137) 10-07 03:55:13.073: E/AndroidRuntime(1665): at android.app.ActivityThread.main(ActivityThread.java:5103) 10-07 03:55:13.073: E/AndroidRuntime(1665): at java.lang.reflect.Method.invokeNative(Native Method) 10-07 03:55:13.073: E/AndroidRuntime(1665): at java.lang.reflect.Method.invoke(Method.java:525) 10-07 03:55:13.073: E/AndroidRuntime(1665): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 10-07 03:55:13.073: E/AndroidRuntime(1665): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 10-07 03:55:13.073: E/AndroidRuntime(1665): at dalvik.system.NativeStart.main(Native Method)