Use following code.
private class UpdateTask extends AsyncTask {
protected String doInBackground(String... urls) {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();
return null;
}
}
and in your ManinActivity Use following code.
new UpdateTask().execute();