How to send data to a website using httpPost, app crashes [duplicate]
This question already has an answer here: How do I fix 'android.os.NetworkOnMainThreadException'? 54 answers Currently I am working on a project. I need to send some data from my android app to a webserver. But when I touched the send button the app crashes. Here is my .java file package com.androidexample.httppostexample; import java.io.IOException; import org.apache.http.client.ClientProtocolException; import java.util.ArrayList; import java.util.List; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client