我正在尝试通过使用glide库将joeschmoe头像加载到我的ImagView中。我正在这样做:-
Glide.with(getActivity())
.asBitmap()
.load("https://joeschmoe.io/api/v1/random")
.into(imageView);
但头像未加载;
我也尝试过:-
Glide.with(getActivity()).load("https://joeschmoe.io/api/v1/random").into(imageView);
但也不能正常工作。
Logcat的读数是:-
class java.io.IOException: java.lang.RuntimeException: setDataSource failed:
status = 0x80000000
2020-03-26 01:12:45.833 21573-21573/com.example.hdwallpapers I/Glide: Root cause (1 of 2)
java.io.IOException: java.lang.RuntimeException: setDataSourceCallback failed: status = 0x80000000
at com.bumptech.glide.load.resource.bitmap.VideoDecoder.decode(VideoDecoder.java:185)
at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:92)
at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:70)
at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:59)
at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:76)
at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:57)
at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:524)
at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:488)
at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:474)
at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:426)
at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:390)
at com.bumptech.glide.load.engine.SourceGenerator.onDataFetcherReady(SourceGenerator.java:176)
at com.bumptech.glide.load.engine.DataCacheGenerator.onDataReady(DataCacheGenerator.java:94)
我检查了这个joeschmoe.io网站,并在浏览器中进行了检查。该图像不是位图,而是SVG
图像。用滑行加载svg,我建议看看这个link。