Reputation: 11158
I have an View subclass and it call onDraw but the screen is not updated at once.
Note that, when I set my app to compatibility SDK (Target SDK Api Level 8)
it works. Target SDK 14
it is never gets updated.
The onDraw is called, but it's like drawing to a sink.
What could be wrong?
EDIT: I saw that it's actually an GLES20Recording canvas for drawing, but this doesn't explain why it doesn't redraw. When I set the view to software rendering mode, it draws.
Upvotes: 1
Views: 1184
Reputation: 11158
I found the solution, Views have to be software accelerated.
view.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
Stupid, but it works.
Upvotes: 1
Reputation: 6201
With API 14 your app is hardware accelerated. Are you sure you are calling invalidate() on the View that contains this drawPath code?
Thanks
Upvotes: 0
Reputation: 17140
To force a view to draw, to call invalidate() or postInvalidate(). This can be done on any view subclass.
Upvotes: 0