私のプロジェクトの 1 つで、私はloopj asynchttpclient
自分の Web サイトとの通信に使用しています。通信部分はうまく機能し、応答も得られます
私の活動は次のようになります
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
WebRequest test=new WebRequest();
test.callService();
}
WebRequest クラスとして
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());
}
});
}
}
その応答からリストビューを作成できるように、応答をメインアクティビティに返す方法がわかりません。
私はこれに慣れていないので、助けてください よろしくお願いします