title: How to transport ToggleButton to SecondActivity
body: <p>I've got a problem. I need to transport my <code>TooggleButton</code> to <code>SecondActivity</code> with saved state and I completely don't know how to do it.
  I've got something like this if <code>MainActivity</code>:</p>
  
  <pre><code>public void changeButton(View view)
  {
      boolean on = ((ToggleButton) view).isChecked();
  
      if(on)
      {
          view.setBackgroundColor(Color.rgb(59, 223, 59));
          Intent intent = new Intent(this, Basket.class);
          intent.putExtra(Basket.TOGGLE_ON_EXTRA, getToggleState());
          startActivity(intent);
  
      }
      else
      {
          view.setBackgroundColor(Color.rgb(255, 100, 100));
      }
  }
  </code></pre>
  
  <p>and SecondActivity</p>
  
  <pre><code>public class Basket extends ActionBarActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_basket);
      Intent intent = getIntent();
      boolean toggleOn = intent.getBooleanExtra(TOGGLE_ON_EXTRA, false);
  }
  </code></pre>
  
  <p>Seriously only this part works fine</p>
  
  <pre><code> public void changeButton(View view)
  {
      boolean on = ((ToggleButton) view).isChecked();
  
      if(on)
      {
          view.setBackgroundColor(Color.rgb(59, 223, 59));
  
      }
      else
      {
          view.setBackgroundColor(Color.rgb(255, 100, 100));
      }
  }
  </code></pre>
  
  <p>In first example, problems are <code>TOGGLE_ON_EXTRA</code> and <code>getToggleState()</code>.</p>