Android Warning: Avoid object allocations during draw/layout operations (preallocate and reuse instead)

You should avoid allocating objects during a drawing or layout operation. These are called frequently, so a smooth UI can be interrupted by garbage collection pauses caused by the object allocations. The way this is generally handled is to allocate the needed objects up-front and reuse them for each drawing operation. Some methods allocate memory on your behalf (such as Bitmap.create
()), and this should be developed in the same way.”

یک نظر ارسال کنید