当我将图像URL加载到ImageView时它工作正常。但我有特定的网址,它没有在imageview中显示,但它显示在网络浏览器中。
如何使用fresco / picasso / glide显示图像对于android。
图片链接是 - https://www.tiket.com/img/business/m/i/business-mirahhotelbanyuwangi-hotel-banyuwangi138.jpg
谢谢
final OkHttpClient client = new OkHttpClient.Builder()
.protocols(Collections.singletonList(Protocol.HTTP_1_1))
.callTimeout(5, TimeUnit.MINUTES)
.readTimeout(5, TimeUnit.MINUTES)
.writeTimeout(5, TimeUnit.MINUTES)
.build();
final Picasso picasso = new Picasso.Builder(this)
.downloader(new OkHttp3Downloader(client))
.build();
Picasso.setSingletonInstance(picasso);
//也检查没有设置setSingletonInstance但不起作用
Picasso.with(context)
.load(imgURL)
.error(R.drawable.ic_no_image)
.into(ivPhoto);