Why do my buttons stay pressed?

Posted by Timmmm on Stack Overflow See other posts from Stack Overflow or by Timmmm
Published on 2010-03-21T16:38:58Z Indexed on 2010/03/21 16:41 UTC
Read the original article Hit count: 306

Filed under:
|
|
|

In my activity I respond to an onClick() by replacing the current view with a new one (setContentView()). For some reason when I do this and then go back to the original view later the button I originally pressed still looks like it is pressed.

If you 'refresh' it somehow (e.g. scroll over it with the trackball) then it reverts to the unpressed state. It's as if the button doesn't get the 'touch-up' event.

The weird thing is: This only happens on my T-Mobile Pulse (android 1.5). It doesn't happen on the emulator.

I've tried calling invalidate()/postInvalidate() on the view when I show it but it doesn't have any effect.

© Stack Overflow or respective owner

Related posts about android

Related posts about button