我有一个异步任务,使用HTTPClient从网页下载数据。问题是毕加索下载图像时,异步任务必须等待图像下载完成。
如何在图像下载之前运行异步任务?
我尝试了这个,但它不起作用:
protected Void doInBackground() {
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
}
答案 0 :(得分:0)
private Target target = new Target() {
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
//Set the Bitmap into any views if you want.
// Start AsyncTask Here.
}
@Override
public void onBitmapFailed() {
}
}
private void someMethod() {
Picasso.with(this).load("url").into(target);
}