Android View Viewgroup Invalidate Ondraw And Draw
We're trying to write our own MapView, and I'm trying to figure out how adding overlays to the mapview causes them to get drawn in other mapping APIs I've got a MapView that extend
Solution 1:
Calling invalidate
on your viewgroup will force draw
to run which will in turn call onDraw
and then dispatchDraw
. You should have a look at the view documentation here and the View source code here for more information.
Solution 2:
invalidate()
has to be called from UI thread to cause onDraw()
. Try to use postInvalidate()
which should have the same effect as invalidate()
, but works from non UI threads.
Post a Comment for "Android View Viewgroup Invalidate Ondraw And Draw"