Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java android中图像视图中未加载特定于图像的URL链接_Java_Android - Fatal编程技术网

Java android中图像视图中未加载特定于图像的URL链接

Java android中图像视图中未加载特定于图像的URL链接,java,android,Java,Android,当我将图像URL加载到ImageView时,它工作正常。 但我有一个特定的url,它并没有显示在imageview中,而是显示在web浏览器中 如何使用fresco/picasso/glide For android显示图像 图像链接是- 多谢各位 final OkHttpClient client = new OkHttpClient.Builder() .protocols(Collections.singletonList(Protocol.HTTP_1_

当我将图像URL加载到ImageView时,它工作正常。 但我有一个特定的url,它并没有显示在imageview中,而是显示在web浏览器中

如何使用fresco/picasso/glide For android显示图像

图像链接是-

多谢各位

 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);
//也可在未设置SETSINGLETONISTANCE但不工作的情况下进行检查

Picasso.with(context)
                    .load(imgURL)
                    .error(R.drawable.ic_no_image)
                    .into(ivPhoto);

使用Glide,您可以使用

Glide
.with(activity)
.load("https://www.tiket.com/img/business/m/i/business-mirahhotelbanyuwangi-hotel-banyuwangi138.jpg")
.placeholder(R.drawable.ic_no_image)
.into(ivPhoto);
也使用

android:usesCleartextTraffic="true"(if android device version is 8+)

在Android清单中的
标记内

如果您不知道@Tigger可能重复,则不要将其标记为重复。如果您有任何解决方案,请使用屏幕截图编写代码