AndroidComponentPeer handlePaintCallback triggered endlessly

gui
#1

Hi,

After adapting my Android app to the new Android approach (with an addRemoveJuceComponent native method) I discovered it became extremely sluggish. I could indentify the problem as being caused by my native UI component being endlessly repainted.

I could trace this back up to the handlePaintCallback method in Android ComponentPeer, but the debugger would not let me see any further. I assume the onDraw method of the Java counterpart is the one triggered, but what could be the reason?

I’m on the latest develop tip. Any hint would be greatly appreciated.

Thanks.

Mariano

0 Likes

#2

Ok, I was able to find out that the constant repainting of the full native component was caused by it including a subcomponent having a timer that repainted it (the subcomponent).

I would assume that only that subcomponent should be repainted, as happens on any other platform. Why is it that this triggers a full onDraw on Android?

0 Likes