源码

首页 » 归档 » 源码 » android – Picasso不支持下载使用https协议的…

android – Picasso不支持下载使用https协议的…


您好我正在使用Picasso库从URL下载图像.

网址:https://fbcdn-profile-a.akamaihd.net/hprofile-ak-prn2/t1.0-1/s200x200/1472865_191408954385576_14109897_n.jpg

URL使用https协议,在这里我无法使用Picasso下载https协议的图像.

它不支持下载使用https协议的图像,只有当我使用http proctocol时它才对我有用吗?

在这里,我试图获取使用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);

任何想法 ?

(0)

本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/android-picassobuzhichixiazaishiyonghttpsxieyide.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:9 月 26, 2019 at 04:17 上午

热评文章