【发布时间】:2018-03-21 10:25:27
【问题描述】:
我想使用 Intent Service 在图像视图中显示在线图像。
public class IntentServiceClass extends IntentService {
public IntentServiceClass() {
super("IntentServiceClass");
}
@Override
protected void onHandleIntent( Intent intent) {
if (intent != null) {
String URLImage = "https://tortoisesvn.net/assets/img/logo-256x256.png";
Bitmap bmp = null;
try{
InputStream inputStream = new java.net.URL(URLImage).openStream();
bmp = BitmapFactory.decodeStream(inputStream);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
我不知道我是否做错了以及如何继续。 有人可以帮帮我吗?
【问题讨论】:
-
你确定你在问什么?
-
为什么使用
IntentService来完成这样的任务使用图像加载器而不是Glide。 -
我只能使用 Intent Service,不能使用任何其他方法。
标签: android image android-intent service show