The custom view onDraw is constantly called

I have a custom view that I override with the onDraw method to draw bitmaps using canvas.

I cannot post any code because it is quite long and complicated.

I put the log in the onDraw method, and I see that it never ceased to be called.

My question is: what can the onDraw method call, except for calling invalidate on the view or its ancestors?

+4
source share
1 answer

found a problem. I called getWidth() and getHeight() in the onDraw() method

0
source

Source: https://habr.com/ru/post/1381720/


All Articles