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