2

I extended a View and call the invalidate() method to force redrawing. I only redraw a part off the View, but everything else is black.

How can I stop clearing the screen before onDraw() is called?

Ussr
  • 197
  • 1
  • 2
  • 14

2 Answers2

3

you can use invalidate(Rect) or invalidate(left, top, right, bottom)

Vyacheslav Shylkin
  • 9,741
  • 5
  • 39
  • 34
0

I don't think this work. As I have used invalidate(Rect). In onDraw(Canvas), u can find the canvas height and width , the same as the view bounds. Canvas clip bounds is the same.

I think this might be work with a view group , but not a view.

dd619
  • 5,910
  • 8
  • 35
  • 60