title: Getting the State of a Toggle Button
body: <p>I may be going about this all wrong, but I have a view that contains a few ToggleButtons and a Save button. When the Save button is pressed, I want to collect the states of the various toggles as boolean values. I have tried the following in the onClickHandler for the Save button:</p>
  
  <pre><code>ToggleButton tb = (ToggleButton) findViewById(R.id.button1);
  boolean pol = tb.isChecked();
  </code></pre>
  
  <p>and I would expect <em>pol</em> to be set to the state of <em>button1</em>, but it keeps being set to <em>true</em>. Of course I have tried this with the button in both states.</p>
  
  <p>Thanks</p>