As an inner class inside your activity:
public final class HttpTask extends AsyncTask<String/* Param */, Boolean /* Progress */, String /* Result */> { private HttpClient mHc = new DefaultHttpClient(); @Override protected String doInBackground(String... params) { publishProgress(true);
Then somewhere in your activity:
new HttpTask().execute(someParams...);
Hubert
source share