Force Stop by Error in httpClient.execute(httpPost); It work's at Smartphone(Android 2.3.3) but Tablet(Android 4.0) => Force Close!!

 public String getXmlFromUrl(String url) {
        String xml = null;

    try {
        // defaultHttpClient
        DefaultHttpClient httpClient = new DefaultHttpClient();
        HttpPost httpPost = new HttpPost(url);

        HttpResponse httpResponse = httpClient.execute(httpPost); // HERE FORCE CLOSE, why???
        HttpEntity httpEntity = httpResponse.getEntity();
        xml = EntityUtils.toString(httpEntity);

    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    } catch (ClientProtocolException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    // return XML
    return xml;
}


Any suggestion with example?
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