android 中使用.Glide加载图片无效,该怎么解决?
public View getView(int position, View view, ViewGroup parent) {
if (view==null) {
view = LayoutInflater.from(getContext()).inflate(resource, parent, false);
}
News news=getItem(position);
ImageView imageView=view.findViewById(R.id.lv_image);
TextView name=view.findViewById(R.id.lv_title);
TextView from=view.findViewById(R.id.lv_from);
TextView time=view.findViewById(R.id.lv_time);
TextView read_num=view.findViewById(R.id.lv_read_num);
String s="http:"+news.getPic();
Log.v("ssss",s);
Glide.with(view.getContext()).load(s).into(imageView);
name.setText(news.getName());
from.setText(news.getFrom());
time.setText(news.getTime());
read_num.setText(news.getRead_num());
return view;
}
报错
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There were 2 causes:
java.io.IOException(Cleartext HTTP traffic to image2.thepaper.cn not permitted)
java.io.FileNotFoundException(No content provider: http://image2.thepaper.cn/image/40/838/183.jpg)
大佬们,该怎么解决