Android Killer
Android Killer

Reputation: 18509

Custom View onDraw method is not getting called

I have a custom view which extends View. I am adding this to an activity as setContent(..) after creating its object, but its onDraw() is not getting called more than once. I know that it should be called infinitely.

Any idea why this is happening?

Upvotes: 0

Views: 1971

Answers (1)

weakwire
weakwire

Reputation: 9300

Android 2.2,2.3 tends to call onDraw a lot more than 3.0 and up.You should call onDraw yourself ,or invalidate() , when you want to create an animation or something and don't call it when you don't.

Upvotes: 1

Related Questions