I never developed for Android, but even I can see that the attempt to invalidate inside
onDraw
could go in infinite recursion. Event if this code does not hand to application, this is only because you could have some other bug, so your
onDraw
does not actually handle graphics rendering (if it does, it could be overridden method, or a method added to the invocation list of the event, which might not be the case). When rendering in handled and
invalidate
is called, it would lead to another
onDraw
call, and then on another
invalidate
call, and so on — indirect "infinite"
mutual recursion.
Please see:
http://developer.android.com/training/custom-views/custom-drawing.html[
^].
Pay attention that
onDraw
should be overridden.
And read on how View is invalidated:
http://developer.android.com/reference/android/view/View.html#invalidate%28%29[
^],
http://developer.android.com/reference/android/view/View.html[
^].
—SA