In one of my projects, I use loopj asynchttpclient to communicate with my site. The communication part works well and gets a 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 answer to the main action so that I can create a list from this answer.
I'm new to this please help me Thanks in advance
android android-layout web-services android-asynctask loopj
ramesh
source share