Android Question Latching Button

andrewj

Active Member
Licensed User
Longtime User
Hi,
I want to create a "latching button", which shows one image when in normal state but when pressed stays pressed (and shows a different image) until pressed again. I think I ought to be able to do this with a StateListDrawable, but I can't get it working. Does anyone have some sample code (or can someone point me to a previous article)?

Thanks
Andrew
 

barx

Well-Known Member
Licensed User
Longtime User
Check out the toggle button
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…