privatevoiddisplayImg(ImageViewp_w_picpathView,Stringurl){RequestQueuemQueue=Volley.newRequestQueue(context);ImageLoaderp_w_picpathLoader=newImageLoader(mQueue,newBitmapCache());ImageLoader.ImageListenerlistener=ImageLoader.getImageListener(p_w_picpathView,R.mipmap.ic_launcher,R.mipmap.ic_launcher);p_w_picpathLoader.get(url,listener);//指定图片允许的最大宽度和高度//p_w_picpathLoader.get("https://cache.yisu.com/upload/information/20200312/67/249325.jpg",listener,200,200);}publicclassBitmapCacheimplementsImageLoader.ImageCache{privateLruCache<String,Bitmap>cache;publicBitmapCache(){cache=newLruCache<String,Bitmap>(10*1024*1024){@OverrideprotectedintsizeOf(Stringkey,Bitmapbitmap){returnbitmap.getRowBytes()*bitmap.getHeight();}};}@OverridepublicBitmapgetBitmap(Stringurl){returncache.get(url);}@OverridepublicvoidputBitmap(Stringurl,Bitmapbitmap){cache.put(url,bitmap);}}