public Bitmap getBitmap(Context context) { if (imageCache == null) { imageCache = new LoopImageCache(context); } // 首先加载缓存中的图片 Bitmap bitmap = null; if (url != null) { bitmap = imageCache.get(url); if (bitmap == null) { bitmap = getBitmapFromUrl(url); if (bitmap != null) { imageCache.put(url, bitmap); } } } return bitmap; }