Fixed error java.lang.OutOfMemoryError

Fixed error java.lang.OutOfMemoryError when the function updateBitmap() was called.