我正在使用图片加载器
imgL.displayImage(url, imageview, options);
它正在处理没有空格的图片网址,但不处理带空格的图片网址。例如:
http://hitbullseye.com/includes/testmaster_pdffiles/Indian Army.png
我收到以下错误:
07-05 18:07:13.794: E/ImageLoader(5914): http://www.hitbullseye.com/includes/testmaster_pdffiles/1404249135Indian Army.png
07-05 18:07:13.794: E/ImageLoader(5914): java.io.FileNotFoundException: http://www.hitbullseye.com/includes/testmaster_pdffiles/1404249135Indian Army.png
07-05 18:07:13.794: E/ImageLoader(5914): at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:177)
07-05 18:07:13.794: E/ImageLoader(5914): at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStreamFromNetwork(BaseImageDownloader.java:111)
07-05 18:07:13.794: E/ImageLoader(5914): at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStream(BaseImageDownloader.java:77)
07-05 18:07:13.794: E/ImageLoader(5914): at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.downloadImage(LoadAndDisplayImageTask.java:319)
07-05 18:07:13.794: E/ImageLoader(5914): at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryCacheImageOnDisc(LoadAndDisplayImageTask.java:298)
07-05 18:07:13.794: E/ImageLoader(5914): at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryLoadBitmap(LoadAndDisplayImageTask.java:241)
07-05 18:07:13.794: E/ImageLoader(5914): at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.run(LoadAndDisplayImageTask.java:141)
07-05 18:07:13.794: E/ImageLoader(5914): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
07-05 18:07:13.794: E/ImageLoader(5914): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
07-05 18:07:13.794: E/ImageLoader(5914): at java.lang.Thread.run(Thread.java:864)
我也试过
url.replaceAll(" ","%20");
但同样的错误。有什么想法吗?