库地址:https://github.com/nostra13/Android-Universal-Image-Loader
在android studio 中加入依赖:
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
public class UniversalImgLoader extends AppCompatActivity { ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_universal_img_loader); imageView=(ImageView)findViewById(R.id.image); ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).build(); ImageLoader loader=ImageLoader.getInstance(); loader.init(config); loader.displayImage("http://picm.photophoto.cn/006/018/030/0180300367.jpg",imageView); loader.displayImage("http://picm.photophoto.cn/006/018/030/0180300367.jpg", imageView, new ImageLoadingListener() { @Override public void onLoadingStarted(String imageUri, View view) { } @Override public void onLoadingFailed(String imageUri, View view, FailReason failReason) { } @Override public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) { } @Override public void onLoadingCancelled(String imageUri, View view) { } }); } }