orhanobut / wasp

Compact and easy to use, 'all-in-one' android network solution

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BitmapWaspCache should be a single instance.

zaiyunduan opened this issue · comments

I add some logs in WaspImageHandler.java like,
final String cacheKey = StringUtils.getCacheKey(url, maxWidth, maxHeight);
final Bitmap bitmap = imageCache.getBitmap(cacheKey);
if (bitmap != null) {
imageView.setImageBitmap(bitmap);
Log.d("wasp","cache image : " + url);
return;
} else {
Log.d("wasp","no use cache image : " + url);
}

the print log is,
03-20 23:12:28.068 22170-22170/com.orhanobut.waspsample D/wasp﹕ no use cache image : http://static.cnbetacdn.com/article/2015/0320/3e5026c844185c5.jpg
03-20 23:12:28.068 22170-22170/com.orhanobut.waspsample D/jiayh2﹕ LaunchIconThemeResourcegetDrawable packageName:com.orhanobut.waspsample asetfile:null
03-20 23:12:28.068 22170-22170/com.orhanobut.waspsample D/wasp﹕ no use cache image : http://static.cnbetacdn.com/article/2015/0320/3e5026c844185c5.jpg

Sorry, I am wrong. imageHandler is a static variable in Wasp.Image class.