【发布时间】:2014-06-27 02:04:17
【问题描述】:
您好,我正在使用Picasso 库从 URL 下载图像。
URL 使用 https 协议,这里我无法使用 Picasso 下载 https 协议的图像。
不支持下载使用https协议的图片吗,只有我使用http协议才有效?
这里我正在尝试获取使用 https 协议的位图
com.squareup.picasso.Target target = new com.squareup.picasso.Target() {
@Override
public void onBitmapLoaded(Bitmap bitmap, LoadedFrom loadedFrom) {
userProfile.setBitmap(bitmap);
// call the Web API to register the walker here
new AudioStreetAsyncTask(getActivity(), userProfile, getString(R.string.registration_processing_message), new TaskCompleteListener() {
@Override
public void onTaskCompleted(String jsonResponse) {
Log.d(TAG, jsonResponse);
}
});
}
@Override
public void onBitmapFailed(Drawable drawable) {
userProfile.setBitmap(null);
// call the Web API to register the walker here
new AudioStreetAsyncTask(getActivity(), userProfile, getString(R.string.registration_processing_message), new TaskCompleteListener() {
@Override
public void onTaskCompleted(String jsonResponse) {
Log.d(TAG, jsonResponse);
}
}).execute();
}
@Override
public void onPrepareLoad(Drawable drawable) {}
};
Picasso.with(getActivity()).load(imgUrl.toString()).into(target);
有什么想法吗?
【问题讨论】:
-
能否请您投票并接受我的解决方案,因为它是最新的,并且 nexus700120 提供的解决方案已过时。