/** * 根据web地址,加载图片 * * @param path 图片的web url */ public void loadImageFromWeb(String webUrl, ImageLoadListener listener) { if (webUrl != null) { Bitmap result = getBitmapFromMemCache(webUrl); if (result == null) { addLoadWebImageThreadInPool(webUrl, listener); } else { listener.onLoaded(result); } } else { listener.onLoaded(null); } }
/** * 从sd卡中载入图片 * * @param sdCardPath * @param listener */ public void loadImageFromSdCard(String sdCardPath, ImageLoadListener listener) { if (sdCardPath != null) { Bitmap result = getBitmapFromMemCache(sdCardPath); if (result == null) { // 从sd卡中载入图片并缓存起来 addLoadSdImageThreadInPool(sdCardPath, listener); } else { listener.onLoaded(result); } } else { listener.onLoaded(null); } }