滑行无法加载资源
作者:互联网
我想使用滑行从服务器加载图像时遇到问题
这是我的代码
Glide.with(ImagePreviewActivity.this).load(path).into(img);
这是logcat:
W/Glide: Load failed for
http://localhost/AndroidFileUpload/file/IMG_20171128_153602.JPEG with size
[720x1120]
class
com.bumptech.glide.load.engine.GlideException: Failed to load resource
Cause (1 of 1): class
com.bumptech.glide.load.engine.GlideException: Fetching data failed, class
java.io.InputStream, REMOTE
Cause (1 of 1):
class com.bumptech.glide.load.engine.GlideException: Fetch failed
Cause (1 of 1):
class java.net.ConnectException: failed to connect to localhost/127.0.0.1
(port 80) after 2500ms: isConnected failed: ECONNREFUSED (Connection refused)
如何解决这个问题?任何建议,将不胜感激,谢谢.
解决方法:
从日志中检查此行
class java.net.ConnectException: failed to connect to
localhost/127.0.0.1
这意味着您的映像路径在本地主机上.无法从您的设备访问本地主机.这可能会引起问题.因此,滑行无法加载图像.
标签:android-glide,android 来源: https://codeday.me/bug/20191110/2014635.html