In one of my project, I am using loopj asynchttpclient
for communicating with my website.
The communication part working well and getting response as well
My activity looks like
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
WebRequest test=new WebRequest();
test.callService();
}
WebRequest Class as
public class WebRequest extends Activity {
public void callService(){
AsyncHttpClient client = new AsyncHttpClient();
client.post("http://domain.com/dp/index.php", new AsyncHttpResponseHandler() {
@Override
public void onSuccess(String response) {
Log.v("P",response);
}
@Override
public void onFailure(Throwable e, String response) {
Log.v("PS",e.toString());
}
});
}
}
I am confused how to return the response to the main activity, So that I can create the listview from that response.
I am new to this Please help me Thanks in advance