custom button: properties change, button should be redrawn
Posted
by Rutger
on Stack Overflow
See other posts from Stack Overflow
or by Rutger
Published on 2010-04-18T18:20:28Z
Indexed on
2010/04/18
18:23 UTC
Read the original article
Hit count: 412
Hi
I'm developing an Android app.
I have class derived from button to represent a special type of button. This special type has some properties (integers) and according to these one or more circles have to be drawn on top of the button.
So I overrode the onDraw function, which looks the values up and accordingly draws the circles.
But the class has a function to set new values for its properties. So new values are set but the changes are not reflected in the UI. It seems like the onDraw function is not called.
When later I click the button or show a pop up message above my interface the onDraw function is called and the button is drawn correctly.
So my question: when changing the properties how can I say that the button has to be redrawn?
Thanks a lot!
© Stack Overflow or respective owner