我正在构建一个简单的应用程序,它查询 Web 服务以获取我想要下载的图像的 URL。现在,我通过运行执行AsyncTask查询、处理 XML 以查找图像 URL 并Object使用所有这些详细信息填充 an 来做到这一点。
我想知道我是否可以Object在内部使用它onPostExecute()来创建另一个AsyncTask从对象中的 URL 下载所有图像的对象?
这是我的代码...
protected SongObject doInBackground(LastFMClient... client) {
LastFMClient lfmClient = client[0];
SongObject track = lfmClient.getMusicMetadata();
return track;
}
protected void onPostExecute(SongObject response) {
// create another asynctask here to download images from the URLs in response.
}