Glide添加github
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
网页URL链接转化为Bitemap代码如下:
Bitmap myBitmap = Glide.with(activity)
.asBitmap()
.load(urls)
.submit(100, 100).get();
但是你会发现这 myBitmap 会为空,这是由于Glide要在子线程中才可以,所以代码如下:
new Thread() {
public void run() {
for (int i = 0; i < urls.size(); i++) {
try {
Bitmap myBitmap = Glide.with(activity)
.asBitmap()
.load(urls.get(i))
.submi