【发布时间】:2013-07-21 20:26:51
【问题描述】:
我正在寻找类似以下代码的内容。我知道下面的代码显然是错误的,我只想说明我在寻找什么。
private HttpRequest httpRequest;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// instiantiate the httpRequest
httpRequest = HttpRequest.init();
httpRequest.get("http://www.example.com", HttpRequest.callbackFunction(){
@Override
public void Result(String err, String recv){
// done something here
}
});
}
** 必须在后台工作并使用回调函数实现
** 它必须能够在单个活动上被多次调用。 AsyncTask 不是我想要的东西。
** 我不介意开源库。只要能达到我的要求
【问题讨论】:
-
多个 AsyncTask 有什么问题?
-
Google 的 Volley 可能值得一试。请看这个 SO [thread for details][1] [1]: stackoverflow.com/questions/16659620/…
标签: android httprequest