redrawing a custom view every frame


after some time my app starts, the console gets filled with warnings that say
RenderInspector [W] QueueBuffer time out on <activity name>, count=<num>, avg=<num> ms, max=<num> ms.

it seems to be related to onDraw() in my custom view where i'm trying to make it redraw itself each frame (even when the function only has invalidate() in it)

class MainView(context: Context, attributeSet: AttributeSet?) : FrameLayout(context, attributeSet) {
    init {
        setWillNotDraw(false)
    }
    
    ...
    
    override fun onDraw(canvas: Canvas) {
        
        ...

        invalidate()
    }
}

so my question is how does one redraw a view each frame properly

1
Apr 22 at 3:25 PM
User Avatar p851523
#android

Accepted Answer

turns out the warning is from hyperos and not actually android so case closed

User Avatar p851523
Apr 23 at 3:21 PM
0