http://hukai.me/android-training-course-in-chinese/graphics/displaying-bitmaps/index.html
DisplayingBitmaps
3.1. 不能崩(OOM), 压缩处理,
xUtils2.x com.lidroid.xutils.bitmap.BitmapDisplayConfig, optimizeMaxSizeByView
3.2. 不能卡, 异步, Thread, AsyncTask
3.3. 不能错位, ListView/GridView, setTag, AsyncDrawable
3.4. 快, 缓存, 内存缓存(LruCache), 硬盘缓存
final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);
// Use 1/8th of the available memory for this memory cache.
final int cacheSize = maxMemory / 8;
mMemoryCache = new LruCache<String, Bitmap>(cacheSize) {
@Override
protected int sizeOf(String key, Bitmap bitmap) {
// The cache size will be measured in kilobytes rather than
// number of items.
return bitmap.getByteCount() / 1024;
}
};