0

I want to implement a button that keeps its state after I clicked it and until I click another part of the screen. I don't know how to implement this. I've seen the methods setSelected and setPressed. Do you know if I have to use any of them? Thanks!

  • I saw this one that sounded similar: http://stackoverflow.com/questions/4747311/how-can-i-keep-one-button-as-pressed-after-click-on-it – Blackunknown Mar 07 '14 at 11:50

1 Answers1

0

You can use ToggleButton with style of regular Button and state checked same as click. Then you can control checked state with setChecked(boolean checked) method.

nonahex
  • 677
  • 1
  • 6
  • 9