http://codereview.stackexchange.com/questions/19139/force-stop-by-error-in-httpclient-executehttppost

 

 

You should remember this.

From Android 3.x Honeycomb or later, you cannot perform Network IO on the UI thread and doing this throws android.os.NetworkOnMainThreadException. You must use Asynctask .

You have to put your getXmlFromUrl(..) code inside Asynctask method

For more Information Refer this Link http://developer.android.com/reference/android/os/AsyncTask.html

shareimprove this answer