Implementation
Efficiency
The use of HashMap<Integer, Object> is slow (mapping from an integer to an object).
HashMap<Integer, Object>
Use SparseArray instead:
SparseArray<Bitmap> bitmaps = new SparseArray<Bitmap>() bitmaps.append(i, newBitmap);
See also: