Android: Create TextView that flashes when clicked

Posted by Jeremy on Stack Overflow See other posts from Stack Overflow or by Jeremy
Published on 2010-04-02T19:26:37Z Indexed on 2010/05/26 2:51 UTC
Read the original article Hit count: 300

Filed under:
|

How do I set up a TextView to flash when it is clicked? I essentially want one of the objects that is displayed in a ListActivity, but inside a normal View.

I have tried to do this by adding an OnClickListener, but what I really need is something like adding an On(Un)SelectListener. Using the onClickListener, I can change the TextView background, but obviously the background stays that color. I thought of using a new Handler().postDelayed(new Runnable(){ ... }) kind of thing to reset the backround after some small time, but I did not know if this would be overkill for what I'm trying to do.

What would you recommend?

© Stack Overflow or respective owner

Related posts about android

Related posts about textview