AsyncHttpClient client = new AsyncHttpClient();
RequestParams params = new RequestParams();
params.put("key", value);
client.post(context, URL_YOURURL,
params, new AsyncHttpResponseHandler() {
Progress pd = new Progress(context);
public void onStart() {
super.onStart();
pd.show();
}
@Override
public void onSuccess(int arg0,
Header[] arg1, byte[] arg2) {
try {
JSONObject json = new JSONObject(
new String(arg2));
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void onFailure(int arg0,
Header[] arg1, byte[] arg2,
Throwable arg3) {
}
public void onFinish() {
super.onFinish();
if(pd!=null){
pd.dismiss();
}
}
});
}
I think You are asking for this example.