Doesn't Picasso support to download images which uses https protocol

前端 未结 5 1793
死守一世寂寞
死守一世寂寞 2020-12-01 12:38

Hello I am using the Picasso library to download the images from URL.

URL : https://fbcdn-profile-a.akamaihd.net/hprofile-ak-prn2/t1.0-1/s200x200/14728

5条回答
  •  醉话见心
    2020-12-01 13:30

    Just put this this code in your Application class:

    final OkHttpClient client = new OkHttpClient.Builder()
            .protocols(Collections.singletonList(Protocol.HTTP_1_1))
            .build();
    
    final Picasso picasso = new Picasso.Builder(this)
            .downloader(new OkHttp3Downloader(client))
            .build();
    
    Picasso.setSingletonInstance(picasso);
    

    from this link check it.

提交回复
热议问题